1

EE 2.5.5, Exp:resso Store 1.6.3

The Store Product Details field works fine in the Control Panel, but when using it in a SafeCracker form, I get the following javascript error (from themes/thirdparty/store/cp.min.js):

Uncaught TypeError: Object [object Object] has no method 'sortable' 

Here's the template code I'm using:

{exp:safecracker channel="signups" entry_id="18" return="foobar" }
    {field:product_details}
{/exp:safecracker}

Is there anything else I should be doing to get Store to work with SafeCracker?

  • We need more information to help you. What version of EE, Store, calendar, ect. Also your safecracker template code with the resulting errors – Justin Long Mar 28 '13 at 18:57
  • Hi Steve - I've rewritten your question so you can get a better idea of a concise, specific question which is easy to follow. – Adrian Macneil Mar 30 '13 at 7:52
1

This appears to be a bug in Store introduced by newer versions of EE and/or SafeCracker. We will have a fix out for it shortly.

In the meantime, you can fix it yourself fairly easily by opening ft.store.php, and around line 37, replace this line:

$this->EE->cp->add_js_script(array('ui' => 'datepicker'));

with this:

$this->EE->cp->add_js_script(array('ui' => array('datepicker', 'sortable')));

That will tell SafeCracker that it needs to load the jQuery UI Sortable library, which is included by default in the EE control panel (hence why it is working fine for you in the CP).

| improve this answer | |
  • Thanks. But in the time it took for me to get schooled in proper customer etiquette, and for someone to actually take the time to reproduce the problem, and for an official service channel response, I've managed to find your bug and fix it myself. – Steve Mock Mar 30 '13 at 14:27
3

Are you including your own version of jQuery by chance? This error looks like store is looking for jQuery UI Sortable and it's not present on the jQuery object, which can happen if: you load jQuery, plugins, then load jQuery again, thus overriding the original.

You can disable safecracker's auto jQuery load: http://ellislab.com/expressionengine/user-guide/modules/safecracker/#include-jquery

| improve this answer | |
  • Thank you. No sir. Totally clean install. No other modules. None of my own jQuery in the template head. Nothing. – Steve Mock Mar 29 '13 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.