ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Is fixed_order bugged in 1.6.7?

March 25, 2009 1:33am

Subscribe [2]
  • #1 / Mar 25, 2009 1:33am

    Andrew Smith

    95 posts

    We are doing the following.

    {exp:query sql="collect our comma separated ID array AS articles"}

    {articles} outputs 13,14,15,16,17,18,19

    So we then process the following.

    {exp:weblog:entries 
      weblog="article" 
      fixed_order="{exp:replace find=',' replace='|'}{articles}{/exp:replace}" 
      dynamic="off
      "}
      {entry_id}
    
    {/exp:weblog:entries}

    Which in turn, outputs

    25
    24
    23
    22
    19
    18
    17
    16
    15
    14
    13
    6
    1

    {/exp:query}

    Why is this being re-sorted and ignoring fixed_order?


    Mod Edit: Moved to tech Support

  • #2 / Mar 25, 2009 3:16am

    John Henry Donovan

    12339 posts

    Andrew,

    Can you show us some more of your template. Specifically your query.

    If you use

    {exp:replace find=',' replace='|'}{articles}{/exp:replace}

    outside of the weblog tag do you get the correct IDs?

  • #3 / Mar 25, 2009 8:29pm

    Andrew Smith

    95 posts

    Yes, running:

    {exp:replace find=',' replace='|'}{articles}{/exp:replace}

    Outputs

    13|14|15|16|17|18|19

    Correctly.

    We were forced to use the selecteditems plugin, which appears to be working correctly.

    Strange.

  • #4 / Mar 25, 2009 9:30pm

    Greg Aker

    6022 posts

    Andrew:

    So everything seems to be working correctly?

    -greg

  • #5 / Mar 25, 2009 9:32pm

    Andrew Smith

    95 posts

    It is with the SelectedItems plugin.

    But while the replace output the correct values when debugging, i.e. 13|14|15|16|17|18|19

    Running {exp:weblog:entries fixed_order="{exp:replace find=',' replace='|'}{articles}{/exp:replace}”} never ended up working.

    It simply output in descending entry_id order.

  • #6 / Mar 26, 2009 2:23am

    John Henry Donovan

    12339 posts

    Andrew,

    I suspect it may have something to do with the parse order of the template.

    Putting your replace into a seperate template might do it

    {exp:replace find=',' replace='|'}{embed:article_ids}{/exp:replace}

    then embed it intoyour weblog tag. Untested but worth a shot.

    {exp:weblog:entries fixed_order="{embed='site/replace_template' article_ids='{articles}'"}
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases