All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Order Set Not Created with Error -- EE 2.6.1

Jonathan Gravois 29 May 2013 19:36 problem, rejected

I purchased Low Reorder yesterday and installed the plug-in. I tried to create my first Low Reorder Set but when I submitted the form, I got this:

Fatal error: Call to undefined method EE_Javascript::json_encode() in /var/www/corporate/codeigniter/system/libraries/Javascript.php on line 797.

The set wasn't saved.

EE: 2.6.1 on PHP Version 5.4.6-1ubuntu1.2

Replies

  1. Low 29 May 2013 19:47

    Hmm, can't seem to replicate. What version of Low Reorder are you using? I just released a new version today (2.1.3) which improves EE2.6 compatibility. Can you make sure you're running that version?

  2. Jonathan Gravois 29 May 2013 19:49

    I am using low-reorder-v212 downloaded yesterday. The VP of IT ordered it with his credit card so he downloads the archive. I will ask him to see if an update is available.

  3. Low 29 May 2013 19:56

    I've tried to reproduce it with EE 2.6.1 and LR 2.1.2 on PHP 5.4, but still couldn't replicate.

    Is it an unaltered version of EE you're using?

  4. Jonathan Gravois 29 May 2013 20:25

    If by unaltered you mean that the core hasn't been modified, then yes, it is unaltered.

    The site is unfortunately behind our firewall for development. I would be happy to share a screen with you and give you control if you wanted to mess with the site itself to diagnose the problem because Low Reorder is actually VERY IMPORTANT to our site.

  5. Low 29 May 2013 20:29

    I'd suggest you try and upgrade to 2.1.3 first to see if that solves it. If it does not, I can try and send you a patched file which should help.

  6. Jonathan Gravois 30 May 2013 12:57

    I upgraded to 2.1.3 and get the same error when trying to create a reorder set.

  7. Low 30 May 2013 13:09

    Still can't reproduce this. Do you have any other addons installed, and if so, which ones?

    Drop me an email at hi at gotolow dot com, and I'll send you a patched file which, hopefully, will bypass the error...

  8. Jonathan Gravois 30 May 2013 13:21

    Installed Add-Ons:

    --MODULES--
    1. Assets
    2. Backup Pro
    3. Channel
    4. Channel Images
    5. Email
    6. File
    7. Gmaps
    8. jQuery
    9. Low Reorder
    10. Pages
    11. PDF Press
    12. Playa
    13. Query
    14. Rich Text Editor
    15. RSS
    16. SafeCracker
    17. Search
    18. Wygwam

    --ACCESSORIES--
    1. Better Workflow
    2. Responsive CP

    --EXTENSIONS--
    1. Assets
    2. Backup Pro
    3. Better Workflow
    4. Channel Images Extension
    5. Gmaps
    6. Low Reorder
    7. Low Seg2Cat
    8. Matrix
    9. Mobile
    10. Playa
    11. Rich Text Editor
    12. SafeCracker
    13. Wiki

    --FIELD TYPES--
    (added)
    1. Assets
    2. Better Pages
    3. Matrix
    4. Playa
    5. Wygwam

    --PLUGINS--
    1. Active Record
    2. Deetector
    3 Detect Mobile
    4. Edr State Name (custom)
    5. Edr Stock (custom)
    6. EP Media Resizer
    7. Magpie RSS Parser
    8. Memmber List
    9. Number Formatter
    10. XML Encode

  9. Low 30 May 2013 13:26

    Right, I could re-create the error, but only by hacking a core file. Just to be sure, I'd like you to check the following. So before I send you a patched file...

    Can you open up /system/codeigniter/system/libraries/Javascript.php and look up line #797... what does that say?

  10. Jonathan Gravois 30 May 2013 13:33

    Here's the entire "foreach" structure ( lines 793 - 804)

    [793] foreach ($json_result as $k => $v)
    [794] {
    [795] if ($_is_assoc)
    [796] {
    [797] $json[] = $this->_prep_args($k, TRUE).':'.$this->json_encode($v, $match_array_type);
    [798] //$json[] = $this->_prep_args($k, TRUE).':'.$this->generate_json($v, $match_array_type);
    [799] }
    [800] else
    [801] {
    [802] $json[] = $this->generate_json($v, $match_array_type);
    [803] }
    [804] }

  11. Low 30 May 2013 13:39

    That's your problem right there. I don't know who commented out the line below (#798), but that's the original line. I've reproduced the problem by doing the exact same! So, to solve, uncomment line 798 (remove the double slashes at the beginning) and remove line 797 altogether.

    Looking at a fresh EE 2.6.1 download, this code is not there. Therefore this looks like a modified (hacked) file. You can also try to replace the Javascript.php file with a freshly downloaded one.

  12. Jonathan Gravois 30 May 2013 13:41

    I think the technician from DevDemon made that change when he was trying to get Channel Images to work. I followed your instructions above and Low Reorder is working ( yeah ). I hope this doesn't break Channel Images.

  13. Low 30 May 2013 13:44

    It most definitely shouldn't. The DevDemon tech should never have left that code in, as it refers to a non-existing method in the JS library. Any other add-ons calling the generate_json function will trigger the same error with that left in.

  14. Jonathan Gravois 30 May 2013 13:51

    No worries. I like your add-ins better than theirs anyway, so I trust you.

    I am still not getting this though. (I am experienced in CodeIgniter but EE is new to me for this project)

    I created a reorder set to allow the Content Manager to put our current projects into a specific order for display. The set is named "current_projects." Based on the documentation of Low Reorder, I changed the template to the code below and the order hasn't changed. ( I guess I am missing it AGAIN!!!)

    {exp:channel:entries channel="projects" status="Current"}
    {exp:low_reorder:entries set="current_projects"}

    {title}

    {project_status}:
    {school_served_by_project} - {title}
    {project_description}

    Click for 
    {if project_fact_sheet != ""}
    more info (fact sheet)
    {/if}

    {if project_article != ""}
      |  
    article
    {/if}

      |  
    webcam

    {if project_website != ""}
      |  
    website
    {/if}


    Contact
    {contact_edr_project}

    {contact_edr_project:contact_name}

    {contact_edr_project:contact_name}
    {contact_edr_project:contact_title}
    {contact_edr_project:contact_phone}

    {contact_edr_project:contact_email}

    {/contact_edr_project}
    <!-- /.contact-edr-panel -->

    <!-- end .row -->

    {/exp:low_reorder:entries}
    {/exp:channel:entries}

  15. Jonathan Gravois 30 May 2013 14:41

    OOPS!

    exp:low_reorder:entries REPLACES exp:channel:entries --- AHHHHH!

    Working Now!