Bug #23605 Bug Fixed

Pages Add-on + Live Preview not displaying entry data?

Version: 4.2.1 Reporter: CleverLever

Hello,

I just purchased EE 4 and am hitting an issue with Live Preview not working with my template.

To reproduce: 1. Create a new entry “Page” with Page URI ‘/foo’ and a specific template form the template dropdown 2. Verify page is created in Pages Manager (‘/’ doesn’t list in the “Pages Manager” which might be another bug) 3. Edit same entry and choose “Preview” 4. Notice channel entry data is missing from the template despite the specified template is in preview

I’m just using the Pages module, no other add-ons.

  • Hi CleverLever, sorry for the difficulties you are having. I cannot reproduce your behavior and live preview is working fine with the Pages module.

    1. Is it only field data that is not being rendered, or are you also not seeing standard fields rendered either (title, entry_date, etc.)? If it’s only field data, can you let us know what custom fields you are using in your Channel?
    2. What do you mean by “‘/’ doesn’t list in the Pages Manager”? / is not a valid Page URI.
    3. Please share your Channel Entries tag that is on the template you selected for this entry.
    Derek Jones
    14th May, 2018 at 11:39am
    1. I tried simply rendering {title} and it doesn’t work.
    2. If you specify ‘/’ and navigate into the Pages Manager (admin.php?/cp/addons/settings/pages) it doesn’t show up as a page.
    3. {exp:channel:entries channel=”page” require_entry=”yes”}{title}{/exp:channel:entries}
    CleverLever
    14th May, 2018 at 11:46am
  • What do you mean “If you specify ‘/’ “. If I specify it where? Again, that is not a valid Page URI, as that would just be your homepage, which is controlled by your default template group’s site index template.

    Are you trying to preview an entry with a Page URI of /? Or one of /foo like you originally stated? Have you verified that your channel is named page? Does it work on the front end, and just not in live preview?

    Derek Jones
    14th May, 2018 at 11:48am
    1. I want to use Pages module to control the site’s index, historically I’ve done this
    2. Neither ‘/’ or ‘/foo’ work, I’ve tried both for debugging
    3. Yes
    4. It works just fine on the front end
    CleverLever
    14th May, 2018 at 11:54am
  • Ok thanks CleverLever. I don’t reproduce your issue, but I am getting some incorrect behavior with Pages previews. I’ll report back after digging some more. Could be whatever issue is affecting mine is affecting yours, both just differently.

    Derek Jones
    14th May, 2018 at 1:55pm
  • Thanks Derek, I can provide access to my CP if it helps, I’m also available on Slack.

    CleverLever
    14th May, 2018 at 2:37pm
  • Thanks CleverLever; can you try applying this fix and see if that addresses your reported issue?

    In system/ee/EllisLab/ExpressionEngine/Controller/Publish/Publish.php change line 406 from:

    $uri = $entry->getPageURI();

    to:

    $uri = $entry->getPageURI();
    ee()->uri->page_query_string = $entry->entry_id;
    Derek Jones
    14th May, 2018 at 3:23pm
  • Seemed to do the trick! Thanks Derek.

    CleverLever
    14th May, 2018 at 3:40pm
  • On a related note, is there some sort of other information about why/how ‘/’ should not be a valid Page URI? This is the first time I’m hearing it.

    CleverLever
    14th May, 2018 at 3:41pm
  • Seemed to do the trick! Thanks Derek.

    Perfect, thanks for confirming! This will be in the next release, so you will not have to maintain that patch.

    On a related note, is there some sort of other information about why/how ‘/’ should not be a valid Page URI? This is the first time I’m hearing it.

    Just my faulty memory apparently. 😬 You’re fine.

    Derek Jones
    14th May, 2018 at 3:44pm
  • Okay, should I open another ticket on it not showing up in the “Pages Manager”?

    CleverLever
    14th May, 2018 at 3:46pm
  • Nope, thank you!

    Derek Jones
    14th May, 2018 at 3:47pm
  • Oh wait I can confirm that “bug” is fix now too, sorry should have checked first. Have a good one.

    CleverLever
    14th May, 2018 at 3:48pm
  • Dang,

    Not sure why it was working before but now it’s throwing this “Invalid Page URI” no matter what for me. I can open a new ticket?

    CleverLever
    16th May, 2018 at 4:05pm
  • If you have reproducible steps, yes. It’s all working properly for me, so you’ll need to provide instructions for us to get the error you are seeing.

    Derek Jones
    16th May, 2018 at 4:14pm
  • Ooh sorry false alarm… don’t set base_url to / :D

    CleverLever
    16th May, 2018 at 4:14pm

You must be signed in to comment on a bug report.

  • In system/ee/EllisLab/ExpressionEngine/Controller/Publish/Publish.php change line 406 from:

    $uri = $entry->getPageURI();

    to:

    $uri = $entry->getPageURI();
    ee()->uri->page_query_string = $entry->entry_id;

ExpressionEngine News

#eecms, #events, #releases