I believe because of the commit here:
http://drupalcode.org/viewvc/drupal/contributions/modules/uc_aac/uc_aac....
Running check_plain() on $_POST['attributes'][$aid], which is an array in the case of checkboxes, broke checkbox functionality.
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | jquery_error.jpg | 378.34 KB | dnieweg |
| #6 | aac_error.jpg | 25.85 KB | dnieweg |
Comments
Comment #1
cyu commentedhttp://drupal.org/cvs?commit=393462
Comment #2
cyu commentedLooks like that didn't completely fix things.
Comment #3
cyu commentedFound another spot where check_plain was borking an array of attributes. In the future I'd like to go this route, http://www.phparch.com/2010/07/08/never-use-_get-again/
http://drupal.org/cvs?commit=393468
Comment #4
dnieweg commentedThis doesn't seem quite fixed. I get this error when selecting a checkbox item.
Fatal error: [] operator not supported for strings in /home/xlogicco/intra/sites/all/modules/uc_aac/uc_aac.module on line 92
Using: $Id: uc_aac.module,v 1.10.2.18 2010/07/16 20:57:18 cyu Exp
Comment #5
cyu commentedhttp://drupal.org/cvs?commit=394822
I had only been testing with products that had a variety of attributes, but on a product with only checkbox attributes and with none of the checkboxes checked, the $_POST['attributes'] var is empty. Added a check for that which took care of the warning I was seeing at the same line....however I was unable to reproduce the Fatal error you reported. Can you see if this latest commit takes care of that for you? If not, can you give me steps to reproduce that error. Thanks.
Comment #6
dnieweg commentedHi cYu,
Installed the update and received the same error.
Fatal error: [] operator not supported for strings in /home/xlogicco/intra/sites/all/modules/uc_aac/uc_aac.module on line 92
Have some more details for you.
#1 Here are the modules installed on the site: http://intra.3xlogic.com/content/current-modules
#2 The error occurs when adding the item with the options to the cart.
#3 Tried adding items to the cart both from a user account and an admin account. Same error.
#4 On this product I have two attributes. One a dropdown and the second checkboxes.
#5 I noticed AAC does not do an update of the price like the other controls such as dropdown. In fact, in the attached picture you can see I have a dropdown option with a price of $1,059 which is reflected in the price properly, but I also have a checkbox checked with an additional price of $50 which did not update the price. Maybe this is why you thought the checkboxes were unchecked?
Could it have something to do with Price Per Role? Because all of the standard cost fields are empty since I am using PPR (longwaves module).
I just added prices to the standard Cost / Price fields and same thing. I also noticed that after the fatal error, the +$xxx prices that show up next to the options in the dropdown have disappeared, and remain missing even after clearing the browser cache. Not sure how that could happen ...
Comment #7
dnieweg commentedMore info - It actually DOES work when NO checkboxes are selected. I only get the error when a checkbox is selected.
The oddest thing however is that the Option Prices for my dropdown (+$x,xxx) option stay missing across Chrome, IE, Firefox & Safari, but just for that product that encountered the fatal error when I tried to add it to the cart with the Checkbox checked. The missing attribute prices are still show up in edit mode table and I have even resaved that particular product, reset the Attribute Setting to show the prices and all that. I don't really understand how an error can make that happen?
Maybe it's not related, but it sure is odd to me.
Comment #8
dnieweg commentedOk, I figured what was causing the missing +$x,xxx on my dropdowns.
Apparently if you are running Price Per role and have a dropdown, followed by checkboxes AND you have Price Per Role prices for the checkboxes AND then you enter in Cost & Price for the checkboxes on the Options tab (in addition to the PPR prices on the Option Prices tab, it somehow strips the +$x,xxx prices from the dropdown on render.
When I remove the checkbox prices from the Option tab and leave the PPR prices, the +$,x,xxx returns to my dropdown above it. Hope that was clear.
Anyways, at this point I don't know if it is a PPR issue or an AAC issue.
Comment #9
dnieweg commentedSorry, one more thing I just discovered that I thought I should share .. and then I will be done. lol
I noticed earlier that the checkboxes did not impact the adjustments table, meaning they did not show up in all their various combinations. I've never used checkboxes before so I thought perhaps that was by design (hopeful anyways since that is a feature I have desired to allow product config options without growing the SKU table exponentially).
But then I realized perhaps something is just not working correctly with the addition of a check box attribute. I tried Radio's and they hit the adjustments tab just like the dropdown items do.
Just thought I would share.
Comment #10
dnieweg commentedComment #11
cyu commentedThis is what I found concerning the adjustments tab...
http://www.ubercart.org/forum/support/11757/stock_attribute#comment-53718
Can you disable price per role, see if things work, and then if they do we can move the rest of this conversation over to #824364: Not Compatible with Ubercart Price Per Role and mark this ticket as fixed.
Comment #12
dnieweg commentedI disabled Price Per Role and the same issue is exhibited. I am glad checkboxes do not impact the adjustment tabs by design .. if I can get checkboxes to work with AAC, I will use the heck out of them.
Here is the rundown without PPR:
1) A dropdown attribute with with 4 options, followed by
2) A checkbox attribute with three items.
3) The dropdown works perfectly and updates the price
4) If I do NOT select any of the checkboxes, Add to Cart works fine.
5) If I select any checkbox AAC does NOT update my price on the product page, and
6) When adding to Cart with any checkbox selected the same fatal error appears.
Obviously something is different about my setup than ones that work. I am using jquery-1.3.2.js with Jquery-Update.
I would be glad to do anything needed to assist.
Comment #13
dnieweg commentedMore info with the same product + dropdown + checkboxes and no PPR:
1) With NO checkboxes checked the dropdown works perfectly and updates the price.
2) When a checkbox is checked, it prevents the dropdown from updating the price.
3) As soon as I uncheck the checkbox, the dropdown resumes functioning correctly.
Comment #14
cyu commentedI can't duplicate this behavior. Can you start with a base ubercart + uc_aac install and add some of those modules you use until you see the problem? I tested with the various jquery update releases, but maybe jqueryui, jquerymenu, one of those wysiwyg modules, or other cck modules are somehow breaking the AJAX calls. Maybe even the theme...can you try with Garland and see if that makes a difference?
The error you originally reported makes it sound like something is actually altering the product's attribute array, not just the JS...which is why I thought price per role would be a likely culprit. Not familiar with uc_upsell, but there is an issue already out there for problems with dependent attributes, so maybe that is the related. #715878: Not aware of changes made by Dependent Attributes
Comment #15
dnieweg commentedWell I guess Checkboxes just weren't meant to be for me. I've reduced active modules to a minimum. The only things left are core items, CCK & Views.
Here is the current list: http://intra.3xlogic.com/content/current-modules
Sorry, I really didn't mean for this to turn into a troubleshooting exercise, although I thank you for your assistance. Especially if this is not related to AAC. If you can't duplicate it, I am not sure what else we can do other than for me not to use them.
I also set the theme to Garland. Even disable the Acquia themes and components. I turned off CSS and Javascript file consolidation.
There is just nothing left that I can see except jQuery UI and jQuery Update. I am a bit confused about jQuery versions. version.txt say's 1.73 and the js file is jquery-1.3.2.js.
Thanks again for your help. I guess we should close this as it seems to be specific to my environment.
Cheers,
Dave
Comment #16
dnieweg commentedWell, maybe I did find the issue. Looking at my browsers Error Console I see a long string of this every time I click on a checkbox.
I tried non-minified jQuery Update setting (developers mode) and same thing.
Comment #17
cyu commentedYeah, if you find it to be something specific with uc_aac you can open a new issue, but the problem that this issue was originally opened for is solved.
A couple places where your error is mentioned and related to modules you still have installed:
Filefield: #354445: Imagefield breaks HS
Views: #268130: Apparent JavaScript error in UI
When I say disable everything but uc_aac and ubercart...I mean everything. And then add modules back 1 by 1 until it becomes apparent where the incompatibility is.
Comment #18
dnieweg commentedThe second part of this thread did end up being a bug and was fixed here: http://drupal.org/node/860128