Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Publisher entries display in an odd order

Status Resolved
Add-on / Version Publisher 2.9.0
Severity
EE Version 4.3.1

Aaron Jay

Sep 03, 2018


Description:

Publisher entries pulled from channel entries loop within category archive tag. They appear successfully in correct order in English (default lang), but in what appears to be a random order in Irish.

I’ve attempted to republish entries, change dates (the date field I wish to order by), change entry date, in case publisher is ignoring the order by field.

I’m using the following code, necessary to produce the required layout.

{exp:channel:category_archive channel="timeline" style="linear"}
    {categories}
 <ol>
      {exp:channel:entries channel="timeline" category="{category_id}" orderby="timeline_date" sort="asc" disable="member_data|pagination" cache="yes" refresh="10"}
    <li>{title} (eid: {entry_id})</li>
      {/exp:channel:entries}
   </ol>
<p>    {/categories}<br />
  {/exp:channel:category_archive}

Detailed steps to reproduce the issue:
1. Convert EE2 site to EE4
2. Update Publisher
3. Observe that in the default language, posts are ordered correctly, in Irish they’re not.

 

 

 

#1

Aaron Jay

Comment has been marked private.

#2

BoldMinded (Brian)

Aaron it’ll be a week or so before I can really look into this. The best thing you can do right now is better prepare the site for me to dig around in. Move it to a dev domain and uninstall all addons except Publisher, and delete all content, templates etc not related to the issue, and put just the template code that is having the issue into its own template with no other code at all. Strip it down to the bare minimum to recreate the issue. Then provide FTP and CP access (check the ftp info and make sure the account has wrote permissions in the addons folder). When I get back from vacation I’ll take a look when I can.

#3

BoldMinded (Brian)

The reason I want other addons removed is bc I don’t want their code triggering and making debugging harder.

#4

BoldMinded (Brian)

What happens if you try to order by the edit or entry date, and not a custom field? What is the value of your custom field? Just the year?

#5

BoldMinded (Brian)

I tried to replicate this locally by creating a custom timeline_date field and it appears to be sorting correctly.

The 2nd group of entries starting with Lightning Bolt have a timeline_date set starting with the first day of the month. Fireball is set to the 2nd day of the month and so on. When I do not order by the timeline_date field they are displayed in the exact reverse order, which is the most recently created at the top.

Here is the English results ordered by the timeline_date field (template code below) https://d.pr/i/wOg8uI

And here is the German, which is the same order. https://d.pr/i/W7vPz8

{exp:channel:category_archive channel="cards" style="linear"}
    {categories}
 <ol>
      {exp:channel:entries channel="cards" category="{category_id}" orderby="timeline_date" sort="asc" disable="member_data|pagination" cache="yes" refresh="10"}
    <li>{title} (eid: {entry_id})</li>
      {/exp:channel:entries}
   </ol>
    {/categories}
  {/exp:channel:category_archive}

Did I re-create the issue accurately?

#6

BoldMinded (Brian)

Just checking in b/c I haven’t heard anything back in a few weeks. I’m going to mark this ticket resolved if I don’t hear anything in a day or two.

#7

Aaron Jay

Hi Brian,

I’m going to get a test site ready for you today, can disable / remove plugins etc. I’ve been on annual leave the past 2 weeks, the issue is still present. Hopefully with the test site we can track down what it is.

I’ll follow up once I have the test site details.

Thanks, Sam

#8

Aaron Jay

Comment has been marked private.

#9

Aaron Jay

Comment has been marked private.

#10

BoldMinded (Brian)

I won’t be able to do much without FTP access. If you can provide it, edit the ticket and add it to the fields provided, not in a comment. Thanks.

#11

Aaron Jay

I have the details, but I don’t see any edit ticket button. Am I missing something?

Also, I’ve checked against your previous answer and the code is the same, it doesn’t matter whether I order by asc or desc, I’m seeing the same issue, just reversed. I see that it’s working correctly in your screenshots.

My timeline_date field is of type “date” and they are all set to localized within entries and appear to be correct.

#12

BoldMinded (Brian)

This button isn’t showing up for you at the beginning of the button row? https://d.pr/i/SmWloQ

#13

Aaron Jay

Hi Brian,

No, I don’t see any buttons. Is this within the ticket?

Thanks, Sam

#14

BoldMinded (Brian)

I logged in as you and this is what I see: https://d.pr/i/gpF0Dd

Are you seeing something different?

#15

Aaron Jay

Here’s what I can see: https://pasteboard.co/HFH8shD.png

#16

Aaron Jay

Ahh, status was still set to “Client Wait” where the buttons don’t seem to appear. It’s open all of a sudden and I see them now.

#17

BoldMinded (Brian)

Sounds like a bug 😊 Thanks for mentioning the Client Wait status, I’ll look into fixing that too.

#18

Aaron Jay

No problem, so I’ve modified the ticket now and provided the FTP details. Let me know if you need anything else.

#19

BoldMinded (Brian)

The edit ticket button should be fixed now.

I created a debug template and the entries appear to be in the same order. I’m not sure what is incorrect. http://president.emagination.ie/ga/an-tuachtaran/debug

#20

Aaron Jay

Hi Brian, I’ve tried to change it slightly. I’ve just added the same markup that would be in the main interactive-timeline.html template. Switch between English and Irish to see the difference, even with the lang params on the channel entries tag.

It’s correct in English, incorrect in Irish. You can see the dates flip.

#21

BoldMinded (Brian)

Ok, lets simplify this some more. Whatever tags you use, don’t use cache parameters. I commented out the category_archive and categories tag pair, and limited the entries tag to 10. Showing 50+ entries is too confusing and hard to follow to see the differences.

Take a look at the debug template again, are the entries in the correct order? If not what is the correct order (tell me entry_ids). If they’re in the correct order now, do they get out of order when you re-introduce the category_archive and categories tag pair?

#22

BoldMinded (Brian)

Also, what happens if you remove the category tag parameter from the channel:entries tag?

#23

Aaron Jay

Hi Brian,

I don’t believe it’s the category_archive, or categories pair tags, but I won’t disregard them yet.

While it appears fine when limited to 10, if you increase the limit to 15 while leaving the other tags commented, the same issue occurs again.

In English limited to 15, the entry IDs come in the following order:

<ul> <li>1650</li> <li>1652</li> <li>1564</li> <li>1563</li> <li>1649</li> <li>1562</li> <li>1560</li> <li>1559</li> <li>1648</li> <li>1646</li> <li>1647</li> <li>1645</li> <li>1644</li> <li>1643</li> <li>1642</li> </ul>

In Irish, the entry IDs come in the following order:

<ul> <li>1642</li> <li>1650</li> <li>1652</li> <li>1564</li> <li>1563</li> <li>1649</li> <li>1562</li> <li>1560</li> <li>1559</li> <li>1648</li> <li>1646</li> <li>1647</li> <li>1645</li> <li>1644</li> <li>1643</li> </ul>

Granted in the list above it doesn’t look so bad but if you increase the limit again, you can see it gets worse. I believe there’s 18 in the category we’re testing. It goes 1999, 1998, 1997, 2011, 2010, 2009, 2008, 2007, 2006, 2004, 2003, 2001.

I’ve removed the title, and the count, and just left the ID and date fields. If you looks at the year specifically it should quickly become obvious.

If I were to remove the category tag, they would come in like 2017, 2016 and so on, all the 2017s, all the 2016s, as it’s still ordered by timeline date due to it being a timeline and that being the primary requirement. I’m not sure if the result would change with a higher limit, but I can certainly still observe the issue.

Let me know what to try next, or what you need.

#24

Aaron Jay

Oh sorry, the correct order is the English one, everything should go 2017, 2016, 2015… and so on, they should never be random like they are in Irish

#25

Aaron Jay

Also there doesn’t appear to be any effect by re-introducing the category_archive and categories tags

#26

BoldMinded (Brian)

I think its fixed now. It was using a string compare function to try to sort a date.

#27

Aaron Jay

Hi Brian,

Great, it appears to be working now. So what do I need to do from here? Do I require a plugin update for the live site?

Thanks, Sam

#28

BoldMinded (Brian)

Grab the EntryResult.php file from your dev site.

https://d.pr/i/MRy6Cv

Login to reply