Jump to content

Recommended Posts

Posted

I enabled language support and now I get "Trying to get property of non-object" for lines like:

<p><?= $page->text ?></p>

The content is still available in the backend. On another page I get text from the frontpage with:

<?php
$somepage = $pages->get(1);
?>
...
<p><?= $somepage->text ?></p>

This outputs the text although on the frontpage it doesn't. I also do this on the header. On the frontpage I added some fields that are thus "shared" among all pages the content fails with the error for `<?= $page->text ?>` but not for `<?= $pages->get(1)->text ?>`.

On a third page everything works as expected :huh:

All three pages have different templates.

Additionally if the field is wrapped with frontend editing like so:

<p><edit text><?= $page->text ?></edit></p>

The page source will end up like this:

<p></edit></p>

Before having to dig deep into this:

Any idea what it could be? I var_dumped $page and that gives an object.

Posted

The problem is that although the data is available in the backend, for some reason the data field of the page does not have the fields (+data) when displaying the page.

Haven't found the reason though yet. Maybe some connection got lost in the db while switching from single to multilanguage mode?
But well then the data wouldn't be available with "<?= $pages->get(1)->text ?>" either, wouldn't it?

Posted

So I couldn't figure it out in a reasonable time, so I started fresh from a backup before switching to multi-languages and switched again.
This time it works. So I guess something went wrong whilst installing the appropriate modules.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...