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.

Status Capitialization issue with SAEF

September 01, 2011 11:58pm

Subscribe [4]
  • #1 / Sep 01, 2011 11:58pm

    chrcollins

    77 posts

    I have a status group with status “Open”, “Closed” and “Hidden” however they are stored in exp_status as “open”, “closed” and “Hidden” (note no caps on open & closed). The status is always shown with caps in the status group and channel entries forms on the control panel.  This caused a bug as my SAEF was setting entries to “Open” thus creating two statuses for the entry “Open” and “open”.  Code that checks for “Open” fails if the admin changes the status via the channels entry form in the control panel (which sets the status to “open”). 

      I will fix this in my code using non-case specific string compares.  Maybe this should be noted in the documentation.  I would do it myself but I don’t have the status to comment in the user’s documentation.

  • #2 / Sep 02, 2011 10:10am

    Sue Crocker

    26054 posts

    Hi chrcollins, actually you just went over 100 posts, so you should be able to do so. Are you using the SAEF or SafeCracker? How were you putting in the statuses?

  • #3 / Sep 02, 2011 10:44am

    chrcollins

    77 posts

    I use SafeCracker.  EE 2.1.2

    I would have expected that if the status “Open’ and “Closed” in were converted to lower case in exp_statuses all the user defined statuses would have been converted as well.  I don’t expect this is something you would want to change now however, probably break a lot of sites.

  • #4 / Sep 07, 2011 2:23am

    John Henry Donovan

    12339 posts

    chrcollins,

    Can you share the SafeCracker template code you are using so we can try and replicate this?
    I wish to test in most recent version of EE and SafeCracker before getting you to do upgrade yourself if that indeed does fix your issue.

  • #5 / Sep 07, 2011 11:01am

    chrcollins

    77 posts

    It does not appear to be a SafeCracker problem.  What ever case I use when setting a status w/ safecracker seems to be reflected in the resulting entry in the database.  Its the control panels handling of the default values of open and close that is confusing and misleading.  When creating a new custom status group, open and closed are shown as “Open” and “Closed” with caps on but are stored in the database as “open” and “closed”.  The Channel Entries panel shows the status as “Open” and “Closed” as well while showing other custom statuses in the case they were defined.

      To see this create a custom status group.  Add some custom statuses both upper and lower case.  Then look in exp_statuses and you can see what I am referring to.

      This probably is not a big deal to most users but if you are writing plugins or extensions that manipulate the status field it can be a problem.

  • #6 / Sep 08, 2011 7:36pm

    Dan Decker

    7338 posts

    chrcollins,

    I’ll bring this to the attention if the Devs, and you can do the same by making a Feature Request! For now, I’m going to resolve this out. If you ever need assistance in the future, please feel free to start a new thread.

    Cheers!

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

ExpressionEngine News!

#eecms, #events, #releases