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.

Order By Date field issues with Import

January 26, 2011 4:48pm

Subscribe [4]
  • #1 / Jan 26, 2011 4:48pm

    bachcoms

    6 posts

    I’m having a very similar issue. I’m trying to display a large number of entries using the following:

    {exp:channel:entries channel="library" limit="100" orderby="pub_date" sort="desc"}
    {pub_date format="%F %j, %Y"}
    <a href="http://{title_permalink=library/detail}">{title}</a>
    {/exp:channel:entries}

    All of the pre-2001 entries are appearing at the top of the list.

    I’m hoping there is a way to resolve this, since I just imported hundred of entries with the assumption that I would be able to order them by the custom date field “pub_date”.

    I’m on v2.1.1 Build 20101020

    Thanks in advance…

  • #2 / Jan 27, 2011 10:20am

    Sue Crocker

    26054 posts

    Hi, bachcoms. What did you use to import the entries? what value is in the pub_date? Is it what you expect to see?

  • #3 / Jan 27, 2011 10:59am

    bachcoms

    6 posts

    Hi Sue,

    I used AJW Datagrab and it worked like a charm. I previewed the new entries on my site following the import, and everything was perfect. Then I went in and changed the order of the fields in the channel to which I’d just imported the data. Immediately afterward, the data wouldn’t sort, and all the pre 2001 entries appeared at the top. (I noticed someone else on the forum experienced this kind of thing after re-ordering their fields).

    I’ve since messed it up by trying to change the data type directly in the database, so will have to delete the entries and re-do the import. But the original issue remains, which is that it seems that re-ordering fields is causing EE to alter the data type in the database.

  • #4 / Jan 27, 2011 12:35pm

    bachcoms

    6 posts

    I just did the following to isolate the problem:

    1. Deleted all entries in the channel, using EE
    2. Deleted the custom date field in EE
    3. Re-added the custom date field in EE
    4. Manually added four test entries in EE, dated 1993, 2000, 2004 and 2010
    5. Checked the site to confirm EE was ordering by pub_date and sorting in descending order. Everything is working perfectly at this point.
    6. Went into the field group and changed the sort order of the custom date field “pub_date”
    7. Checked the site and confirmed that, bingo, the sort is broken

    Thoughts on what is going on here?

  • #5 / Jan 28, 2011 2:09am

    John Henry Donovan

    12339 posts

    bachcoms,

    I’m on v2.1.1 Build 20101020

    Can I get you to upgrade to latest release (EE 2.1.3) please and see if issue persists.

  • #6 / Jan 28, 2011 2:03pm

    bachcoms

    6 posts

    Updated to latest build and it seems to have fixed it. Thanks.

  • #7 / Jan 29, 2011 4:56pm

    Greg Salt

    3988 posts

    Hi bachcoms,

    Good stuff. Please post back if required.

    Cheers

    Greg

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases