nightjarnz

magic happens to make it seem like the property is on the one you're extending.

nightjarnz

$footerExtension->ElementItemsCustom $siteConfig->ElementItemsCustom ✔️

nightjarnz

@Henry you don't operate on the extension - the extension applies to a DataObject, and you operate on the instance of the data object.

👍 (1)
Henry

I am getting this error

  1. Uncaught Error: Call to undefined method FooterExtension::ElementItemsCustom()

What am I doing wrong? (sorry in advance if I am doing something dumb)

Henry

Hi, I want to use elementalArea in SiteConfig area to then display it in the footer. This is my class

  1. class FooterExtension extends DataExtension
  2. {
  3. private static $has_one = [
  4. 'ElementItemsCustom' => ElementalArea::class
  5. ];
  6. public function updateCMSFields(FieldList $fields)
  7. {
  8. $options = $this->ElementItemsCustom();
  9. .....
Henry

Does anyone else have this issue when creating a new form? I am using dnadesign/silverstripe-elemental-userforms

Files: Requires logging in with Slack to view/download
Screen Shot 2020-07-29 at 9.49.52 pm.png
Chrissi

The error is coming from the symbiote/silverstripe-gridfieldextensions module which isn’t used by elemental-userforms. So I think it’s some other part of your code which is causing this issue.

Henry

Hi, yes, symbiote/silverstripe-gridfieldextensions 3.2.3 was the problem. Downgrading to symbiote/silverstripe-gridfieldextensions 3.2.1 fixes the issue.

👍 (1)
oilee80

Heya all, I’ve done a fix for Elemental and raised a https://github.com/dnadesign/silverstripe-elemental/pull/816 just wondering how best to get it approved & merged? I’ve gotten our project on a fork at the moment but would obviously like to get back to the main repo

Show 1 attachment(s)
oilee80

Otherwise when you change PageType it can cause issues with retrieving
the Elements for the page

This is an alternative fix for https://github.com/dnadesign/silverstripe-elemental/pull/671|#671 based on feedback comments

Hide attachment content
robbieaverill

Hey dude, you have a linting issue in that PR. Could you fix that up?