module installed and it shows the new option in the add/edit product node...
I didn't find any menu items in my administration so didn't adjust any settings...

when I select a country to add a new price, then I get a pop-up box that sais :
******************
An error occured.
/uc_multiprice/js
(no information available)
********************
so I can not add prices...

what am I doing wrong ? (I attached a screenshot)

CommentFileSizeAuthor
#30 Picture 5.JPG54.48 KBmarvzz
multiprice_screenshot.jpg42.5 KBHansR
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Docc’s picture

Status: Active » Postponed (maintainer needs more info)

There are no global settings for multiprice.

Wich version of Drupal are you using? anything in your error log? and does this happens in multiple browsers?

HansR’s picture

nothing in the error log

happens in Internet Explorer, which still represents 95% of visitors...

Using Drupal 6.9 , going to upgrade soon.

HansR’s picture

Status: Postponed (maintainer needs more info) » Reviewed & tested by the community
Docc’s picture

k i tried it in IE 8 the other day and got the js error.
After some debugging it seems the POST from the ajax call is empty. I really have no clue why this is happening and it only occurs in IE. Ill check back if i know something more.

HansR’s picture

yes... Ajax doesn't seem to do what it needs to do in IE... :-(

But as I said... unfortunately... 95% of my visitors still use IE, so can no just ignore it.

but thanks for looking into it. Looking forward to some feedback soon.

Docc’s picture

Problem is only on the node/product edit form. So "visitors" wont be bothered by it.

HansR’s picture

yes, I understand that... but I need to be able to add it to the site right ? Aslong as I can not add it... No point having it...

heavy_engineer’s picture

I can confirm this on Linux FF3 and Chrome. I get a JS alert:

An error occurred. 
/uc_multiprice/js
<br />
<b>Fatal error</b>:  Unsupported operand types in <b>/home/steev/workspace/website/modules/uc_multiprice/uc_multiprice.module</b> on line <b>484</b><br />

And line 484 (CVS Head) and 456 (Dev + stable (from memory)) goes like this:

$form['multiprice']['countries'] += $field;

in this code block:

	$country_id = check_plain($_POST['multiprice']['more']['list']);
	if ($country_id != 0) {
		// new field
		$country = db_fetch_object(db_query("SELECT * FROM {uc_countries} WHERE country_id = %d", $country_id));
		$field = uc_multiprice_field_element($country);
		$form['multiprice']['countries'] += $field;
	}

Im going to attempt to work out whats up - from what i've read its an ahah form issue, something to do with the way the forms are cached and then redisplayed. It doesnt appear to be a js error tho, although the error message is in a js alert.

If anyone listening knows more than i do, please point me in the right direction. Will post back if i get anywhere with it.

heavy_engineer’s picture

I cant get this any further forward.

seems $form['multiprice']['countries'] is not an array (which it should be).

**Snip**

After much toing and froing i did get it kind of working but, the way the module interacts with the new price api (i.e. i dont think it knows about it) is causing this problem. If i set the values in the db it works well, but the currency is formatted incorrectly - as the default, e.g. £ instead of $.

The ahah stuff is kind of a red herring. i think

timl’s picture

make sure if you are using the 'devel' module that it isn't writing stuff to the bottom of each request (i.e. page generation time). I had that switched on and was getting js issues with this module.

william.lai’s picture

We have the same issue and always get following message in IE:
-------------------------------------
An error occurred.
/uc_multiprice/js
(no information avaliable)
-------------------------------------
It seem that the $_POST variable always empty after received in server side.
There is no problem in firefox.

During the checking, we found a php issue seem related to enctype="multipart/form-data" and POST.
http://bugs.php.net/bug.php?id=26004

But no idea on how to fix it.
Thanks.

zbrooks’s picture

I was also able to resolve this by disabling Devel, might bare looking into though.

smartsystems160’s picture

I have this error too in IE, Mozilla, Chrome, and Opera, but none of this error shows up when i use my admin account to set the multiprice. It only happens with my seller accounts which means its a real problem if i am offering multiseller ability. I guess something needs to be done about this. But Great module. Thanks and hoping this is good info for you to work on...

Docc’s picture

Hey guys,

Seems i added the permission "administer nodes" to the AJAX callback.
So if the user does not have that permission the call will fail.

Ill fix this in the next week.

Anyone having this issue as user 1?

smartsystems160’s picture

Category: bug » task
Priority: Critical » Major
Status: Reviewed & tested by the community » Active

Hi Docc,

user 1 is ok for me. I noticed something else in this dev version. Nigeria is conspiciously absent among the list of countries, dont know if there are any other countries absent in the list. Sorry i am not a coder at all, so dont know if its from my setting or not. Just hope you look it up too. Thanks. waiting for the patch.

Docc’s picture

Did you enabled the country on the countries admin screen? "admin/store/settings/countries"

smartsystems160’s picture

Yes i enabled all countries. Infact, i was using the previous stable version before the dev version and all countries were displayed. but when i installed the dev, i noticed it. All other countries were displayed.

smartsystems160’s picture

Hi Docc,

Just wanted to ask if there is progress on this work....

Thanks

Docc’s picture

Version: 6.x-1.0 » 6.x-2.x-dev
Assigned: Unassigned » Docc
Status: Active » Needs review

Changing version to 2.x. This is where its all happening now. Ill only do security fixes for 1.0
Commited a fix to the dev branche. Check it out and let me know if its working for you all.

Remember to clear the cache/rebuild menu

smartsystems160’s picture

Status: Needs review » Needs work

I have installed the module and tested it, same javascript error, but this time, ERROR ALSO HAPPENS FOR USER 1. The previous error happened to only users apart from 1. still didnt see Nigeria in 'add price override for a country' when creating product or using Multprice defaults UI in store admin->configurations.

Updated: error code: An HTTP error 404 occurred.
/Platform/uc_multiprice/js/

Docc’s picture

Did you rebuild the menu / clear cache?

smartsystems160’s picture

Yes i rebuilt the menu / cleared cache as you instructed

Docc’s picture

Weird, there should be a nid at the end of uc_multiprice/js/
Ill see if i can reproduce the error.

Docc’s picture

Status: Needs work » Needs review

k found the problem. Commited 2 permissions to dev: 'administer multiprice' and 'create & edit multiprices'
Set the right permissions for your users. Let me know if it works for you. (ps clear cache again)

Docc’s picture

Status: Needs review » Closed (fixed)
lpalgarvio’s picture

Category: task » bug
Status: Closed (fixed) » Needs work
Issue tags: +Ubercart, +Devel, +javascript error, +multiprice

still having the same error, when having Devel enabled and configured to display memory usage and/or page timer.

* Display page timer
Display page execution time in the query log box.
* Display memory usage
Display how much memory is used to generate the current page. This will show memory usage when devel_init() is called and when devel_exit() is called. PHP must have been compiled with the --enable-memory-limit configuration option for this feature to work.
An error occurred. 
/uc_multiprice/js/default
{ "status": true, "data": "\x3cdiv id=\"multiprice-countries\"\x3e\x3cfieldset id=\"fieldset-multiprice-multiprices\" class=\"fieldset-multiprice-multiprices collapsible\"\x3e\x3ctable id=\"uc_multiprice_table\" class=\"sticky-enabled\"\x3e\n \x3cthead\x3e\x3ctr\x3e\x3cth width=\"125px\"\x3eCountry/role\x3c/th\x3e\x3cth\x3e\x3c/th\x3e\x3cth\x3eList price\x3c/th\x3e\x3cth\x3e\x3c/th\x3e\x3cth\x3eCost\x3c/th\x3e\x3cth\x3e\x3c/th\x3e\x3cth\x3eSell price\x3c/th\x3e\x3cth\x3eDelete\x3c/th\x3e \x3c/tr\x3e\x3c/thead\x3e\n\x3ctbody\x3e\n \x3ctr class=\"odd\"\x3e\x3ctd\x3eDefault\x3c/td\x3e\x3ctd\x3e\x3c/td\x3e\x3ctd\x3e\x3cdiv class=\"form-item\" id=\"edit-multiprice-multiprices-0-list-price-wrapper\"\x3e\n \x3cinput type=\"text\" maxlength=\"35\" name=\"multiprice[multiprices][0][list_price]\" id=\"edit-multiprice-multiprices-0-list-price\" size=\"20\" value=\"1.00\" class=\"form-text\" /\x3e\n\x3c/div\x3e\n\x3c/td\x3e\x3ctd\x3e\x3c/td\x3e\x3ctd\x3e\x3cdiv class=\"form-item\" id=\"edit-multiprice-multiprices-0-cost-wrapper\"\x3e\n \x3cinput type=\"text\" maxlength=\"35\" name=\"multiprice[multiprices][0][cost]\" id=\"edit-multiprice-multiprices-0-cost\" size=\"20\" value=\"1.00\" class=\"form-text\" /\x3e\n\x3c/div\x3e\n\x3c/td\x3e\x3ctd\x3e\x3c/td\x3e\x3ctd\x3e\x3cdiv class=\"form-item\" id=\"edit-multiprice-multiprices-0-sell-price-wrapper\"\x3e\n \x3cinput type=\"text\" maxlength=\"35\" name=\"multiprice[multiprices][0][sell_price]\" id=\"edit-multiprice-multiprices-0-sell-price\" size=\"20\" value=\"1.00\" class=\"form-text\" /\x3e\n\x3c/div\x3e\n\x3c/td\x3e\x3ctd\x3e\x3c/td\x3e \x3c/tr\x3e\n \x3ctr id=\"edit-multiprice-multiprices-0-edit-list-price-dynamic\" class=\"popup even\"\x3e\x3ctd colspan=\"8\"\x3e\x3c/td\x3e \x3c/tr\x3e\n \x3ctr id=\"edit-multiprice-multiprices-0-edit-cost-dynamic\" class=\"popup odd\"\x3e\x3ctd colspan=\"8\"\x3e\x3c/td\x3e \x3c/tr\x3e\n \x3ctr id=\"edit-multiprice-multiprices-0-edit-sell-price-dynamic\" class=\"popup even\"\x3e\x3ctd colspan=\"8\"\x3e\x3c/td\x3e \x3c/tr\x3e\n \x3ctr class=\"odd\"\x3e\x3ctd\x3eFrance\x3c/td\x3e\x3ctd\x3e\x3cinput type=\"submit\" name=\"op\" id=\"edit-multiprice-multiprices-country-250-edit-list-price\" value=\"\"  class=\"form-submit dynamic\" /\x3e\n\x3c/td\x3e\x3ctd\x3e\x3cdiv class=\"form-item\" id=\"edit-multiprice-multiprices-country-250-list-price-wrapper\"\x3e\n \x3cinput type=\"text\" maxlength=\"35\" name=\"multiprice[multiprices][country][250][list_price]\" id=\"edit-multiprice-multiprices-country-250-list-price\" size=\"10\" value=\"0.00\" class=\"form-text\" /\x3e\n\x3c/div\x3e\n\x3c/td\x3e\x3ctd\x3e\x3cinput type=\"submit\" name=\"op\" id=\"edit-multiprice-multiprices-country-250-edit-cost\" value=\"\"  class=\"form-submit dynamic\" /\x3e\n\x3c/td\x3e\x3ctd\x3e\x3cdiv class=\"form-item\" id=\"edit-multiprice-multiprices-country-250-cost-wrapper\"\x3e\n \x3cinput type=\"text\" maxlength=\"35\" name=\"multiprice[multiprices][country][250][cost]\" id=\"edit-multiprice-multiprices-country-250-cost\" size=\"20\" value=\"0.00\" class=\"form-text\" /\x3e\n\x3c/div\x3e\n\x3c/td\x3e\x3ctd\x3e\x3cinput type=\"submit\" name=\"op\" id=\"edit-multiprice-multiprices-country-250-edit-sell-price\" value=\"\"  class=\"form-submit dynamic dynamic_on\" /\x3e\n\x3c/td\x3e\x3ctd\x3e\x3cdiv class=\"form-item\" id=\"edit-multiprice-multiprices-country-250-sell-price-wrapper\"\x3e\n \x3cinput type=\"text\" maxlength=\"35\" name=\"multiprice[multiprices][country][250][sell_price]\" id=\"edit-multiprice-multiprices-country-250-sell-price\" size=\"20\" value=\"2.00\" class=\"form-text\" /\x3e\n\x3c/div\x3e\n\x3c/td\x3e\x3ctd\x3e\x3cdiv class=\"form-item\" id=\"edit-multiprice-multiprices-country-250-delete-wrapper\"\x3e\n \x3cinput type=\"checkbox\" name=\"multiprice[multiprices][country][250][delete]\" id=\"edit-multiprice-multiprices-country-250-delete\" value=\"1\"   class=\"form-checkbox\" /\x3e\n\x3c/div\x3e\n\x3c/td\x3e \x3c/tr\x3e\n \x3ctr id=\"edit-multiprice-multiprices-country-250-edit-list-price-dynamic\" class=\"popup even\"\x3e\x3ctd colspan=\"8\"\x3e\x3cdiv class=\"form-item\" id=\"edit-multiprice-multiprices-country-250-dynamic-list-price-enabled-wrapper\"\x3e\n \x3clabel class=\"option\" for=\"edit-multiprice-multiprices-country-250-dynamic-list-price-enabled\"\x3e\x3cinput type=\"checkbox\" name=\"multiprice[multiprices][country][250][dynamic][list_price][enabled]\" id=\"edit-multiprice-multiprices-country-250-dynamic-list-price-enabled\" value=\"1\"   onclick=\"uc_multiprice_dynamic(\x26quot;250\x26quot;, \x26quot;list_price\x26quot;, \x26quot;country\x26quot;);\" class=\"form-checkbox\" /\x3e Enabled\x3c/label\x3e\n \x3cdiv class=\"description\"\x3eCalculate list price for France\x3c/div\x3e\n\x3c/div\x3e\n\x3cinput type=\"hidden\" name=\"multiprice[multiprices][country][250][dynamic][list_price][type]\" id=\"edit-multiprice-multiprices-country-250-dynamic-list-price-type\" value=\"list_price\"  /\x3e\n\x3cfieldset\x3e\x3cdiv class=\"form-item\" id=\"edit-multiprice-multiprices-country-250-dynamic-list-price-1-operator-wrapper\"\x3e\n \x3cselect name=\"multiprice[multiprices][country][250][dynamic][list_price][1][operator]\" onchange=\"uc_multiprice_dynamic(\x26quot;250\x26quot;, \x26quot;list_price\x26quot;, \x26quot;country\x26quot;);\" class=\"form-select\" id=\"edit-multiprice-multiprices-country-250-dynamic-list-price-1-operator\" \x3e\x3coption value=\"default\"\x3eDefault\x3c/option\x3e\x3coption value=\"custom\" selected=\"selected\"\x3eCustom\x3c/option\x3e\x3c/select\x3e\n\x3c/div\x3e\n\x3cdiv class=\"form-item\" id=\"edit-multiprice-multiprices-country-250-dynamic-list-price-1-value-wrapper\"\x3e\n \x3cinput type=\"text\" maxlength=\"128\" name=\"multiprice[multiprices][country][250][dynamic][list_price][1][value]\" id=\"edit-multiprice-multiprices-country-250-dynamic-list-price-1-value\" size=\"5\" value=\"0\" onchange=\"uc_multiprice_dynamic(\x26quot;250\x26quot;, \x26quot;list_price\x26quot;, \x26quot;country\x26quot;);\" class=\"form-text\" /\x3e\n\x3c/div\x3e\n\x3c/fieldset\x3e\n\x3cfieldset\x3e\x3cdiv class=\"form-item\" id=\"edit-multiprice-multiprices-country-250-dynamic-list-price-operator-value-wrapper\"\x3e\n \x3cselect name=\"multiprice[multiprices][country][250][dynamic][list_price][operator][value]\" onchange=\"uc_multiprice_dynamic(\x26quot;250\x26quot;, \x26quot;list_price\x26quot;, \x26quot;country\x26quot;);\" class=\"form-select\" id=\"edit-multiprice-multiprices-country-250-dynamic-list-price-operator-value\" \x3e\x3coption value=\"x\"\x3ex\x3c/option\x3e\x3coption value=\"-\"\x3e-\x3c/option\x3e\x3coption value=\"+\"\x3e+\x3c/option\x3e\x3coption value=\"/\"\x3e/\x3c/option\x3e\x3c/select\x3e\n\x3c/div\x3e\n\x3c/fieldset\x3e\n\x3cfieldset\x3e\x3cdiv class=\"form-item\" id=\"edit-multiprice-multiprices-country-250-dynamic-list-price-2-operator-wrapper\"\x3e\n \x3cselect name=\"multiprice[multiprices][country][250][dynamic][list_price][2][operator]\" onchange=\"uc_multiprice_dynamic(\x26quot;250\x26quot;, \x26quot;list_price\x26quot;, \x26quot;country\x26quot;);\" class=\"form-select\" id=\"edit-multiprice-multiprices-country-250-dynamic-list-price-2-operator\" \x3e\x3coption value=\"default\" selected=\"selected\"\x3eDefault\x3c/option\x3e\x3coption value=\"custom\"\x3eCustom\x3c/option\x3e\x3c/select\x3e\n\x3c/div\x3e\n\x3cdiv class=\"form-item\" id=\"edit-multiprice-multiprices-country-250-dynamic-list-price-2-value-wrapper\"\x3e\n \x3cinput type=\"text\" maxlength=\"128\" name=\"multiprice[multiprices][country][250][dynamic][list_price][2][value]\" id=\"edit-multiprice-multiprices-country-250-dynamic-list-pric (...)

If you have the page timer and memory usage from Devel disabled, no error occurs.
Also no error occurs/there is no change in the error by having Caching, Block caching, Page compression, CSS/JS Gziping and aggregation set to ON or OFF. It does not affect or interact with Devel for that matter.

The problem should be a conflict in function names or variables between UC Multiprice and Devel in the javascript.

using the latest UC Multiprice 2.x-dev
re-opening issue.

Docc’s picture

Priority: Major » Minor

Adding a devel_exit() to the uc_multiprice_js function should fix this issue.

smartsystems160’s picture

Category: bug » task
Priority: Minor » Normal
Status: Needs work » Needs review

Hello Docc,

very sorry i didnt get back to you, i was away to a remote city where i could not access the internet. I tried the update you provided but it still gave the javascript error (An error occured. /uc_multiprice/js) so i went into the code in uc_multiprice.module on line 25, and changed the access from 'administer nodes' to 'access content' and it worked like magic, error dissappeared. U indicated in #14 above that it was the access permission in the code that caused the problem, thats what gave me the clue. I am not a coder, hope i did this right. Thanks for the module, Docc.

the error i am referring to in this case is:
An error occured.
/uc_multiprice/js

Docc’s picture

@itpromanager

The latest dev should work for you. A fix for the permission problem is commited.

marvzz’s picture

FileSize
54.48 KB

i confirm the issue is still present on the latest -dev

harvlad’s picture

@marvzz Have you previously tried patching this module? I had done so, then installed a fresh copy but forgot about the patch file in the root dir.