nickfromtq Posted June 29, 2011 Share Posted June 29, 2011 Hi, Im having a trouble adding or modifying a carrier, i get the error "An error occurred while creating object. carrier"Can anyone provide any advise how i might fix this error. Any help would be very much appreciated. Kind regardsNick Link to comment Share on other sites More sharing options...
MahmutGulerce Posted June 29, 2011 Share Posted June 29, 2011 Would you give a little more detailing? If possible share full error code please Link to comment Share on other sites More sharing options...
nickfromtq Posted June 29, 2011 Author Share Posted June 29, 2011 That is the full error I get, it is in the BO when trying to add a carrier. when I click save it says "An error occurred while creating object. carrier"I have included a screen shot of the error. Thanksnick Link to comment Share on other sites More sharing options...
MahmutGulerce Posted June 29, 2011 Share Posted June 29, 2011 That is the full error I get, it is in the BO when trying to add a carrier. when I click save it says "An error occurred while creating object. carrier"I have included a screen shot of the error. Thanksnick Could you add this lines to your /admin1425/tabs/AdminCarriers.php after line 223 ? print_r($_POST['groupBox']); exit; Than retry to create or update a carrier. It may give me some tips about this bug. Please let me know the printed code may be like Array ( [0] => 1 ) Array ( [0] => 1 ) ) Link to comment Share on other sites More sharing options...
nickfromtq Posted June 29, 2011 Author Share Posted June 29, 2011 Hi, I have pasted the code as requested and nothing has happends, no more details have appeared. my line 223 is <input type="hidden" name="is_module" value="1"> is this correct.Thanksnick Link to comment Share on other sites More sharing options...
MahmutGulerce Posted June 29, 2011 Share Posted June 29, 2011 Hi, I have pasted the code as requested and nothing has happends, no more details have appeared. my line 223 is <input type="hidden" name="is_module" value="1"> is this correct.Thanksnick Im sorry i give wrong line number it must be line 262before foreach ($groups as $group) Link to comment Share on other sites More sharing options...
nickfromtq Posted June 29, 2011 Author Share Posted June 29, 2011 No good either, when i click save it goes to a blank page. Kind regardsNick Link to comment Share on other sites More sharing options...
MahmutGulerce Posted June 29, 2011 Share Posted June 29, 2011 Ok may be a syntax error has occurred due to adding lines. Could you open error displaying ? In /prestashop root /config/config.inc.phpline 29 change @ini_set('display_errors', 'Off'); to @ini_set('display_errors', 'On'); Link to comment Share on other sites More sharing options...
nickfromtq Posted June 29, 2011 Author Share Posted June 29, 2011 Hi, I have changed off to on but no change, it is still a blank page. Kind regardsnick Link to comment Share on other sites More sharing options...
nickfromtq Posted June 29, 2011 Author Share Posted June 29, 2011 Hi, I have taken the code out of admincarriers.php and tried again .this is the message im getting now. Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home2/first4kn/public_html/testsite.co.uk/admin1234/tabs/AdminCarriers.php on line 264I hope this is what you are after. ThanksNick Link to comment Share on other sites More sharing options...
MahmutGulerce Posted June 29, 2011 Share Posted June 29, 2011 Hi, I have taken the code out of admincarriers.php and tried again .this is the message im getting now. Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home2/first4kn/public_html/testsite.co.uk/admin1234/tabs/AdminCarriers.php on line 264I hope this is what you are after. ThanksNick Yes as I predicted line 264 $_POST['groupBox'] variable must be an array but not I advice remove whole line 264 at /Your Admin Dir /tabs/AdminCarriers.phpif (in_array($group['id_group'], $_POST['groupBox'])) Error will be fixed but every carrier will be enabled for all customer groups. Link to comment Share on other sites More sharing options...
nickfromtq Posted June 29, 2011 Author Share Posted June 29, 2011 I have removed that line, and tried to add and modifiy a carrier, now im just getting the error An error occurred while creating object. carrierwith no more additional information. Nick Link to comment Share on other sites More sharing options...
MahmutGulerce Posted June 29, 2011 Share Posted June 29, 2011 If you sure remove if (in_array($group['id_group'], $_POST['groupBox'])) If sure someting goes wrong on your database.Adding define('_PS_DEBUG_SQL_', true); top of the /tabs/AdminCarriers.php. may be shows more detail. Link to comment Share on other sites More sharing options...
nickfromtq Posted June 29, 2011 Author Share Posted June 29, 2011 If you sure remove if (in_array($group['id_group'], $_POST['groupBox'])) If sure someting goes wrong on your database.Addingdefine('_PS_DEBUG_SQL_', true); top of the /tabs/AdminCarriers.php. may be shows more detail. I have done this, it has made no difference, im not getting anymore information appearing. Nick Link to comment Share on other sites More sharing options...
nickfromtq Posted July 2, 2011 Author Share Posted July 2, 2011 Hi, Has anyone got any other ideas how i get fix this error. Many thanksNick Link to comment Share on other sites More sharing options...
burpitt Posted July 5, 2011 Share Posted July 5, 2011 I am having the same problem,"An error occurred while updating object. carrier" with no extra info. Bit of an arse ache as I was hoping to get 1.4.3 back up and live in the coming few days..More info when I turned on debug: Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/diaphrag/public_html/admins/tabs/AdminCarriers.php on line 264 Link to comment Share on other sites More sharing options...
MahmutGulerce Posted July 5, 2011 Share Posted July 5, 2011 I am having the same problem,"An error occurred while updating object. carrier" with no extra info. Bit of an arse ache as I was hoping to get 1.4.3 back up and live in the coming few days..More info when I turned on debug: Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/diaphrag/public_html/admins/tabs/AdminCarriers.php on line 264 This error explains as I sad the $_POST['groupBox'] variable must be an array but isnt at line 264. I guess the check boxes named with groupBox (<input name="groupBox[]"... ) converts to none array if you have only one group. Link to comment Share on other sites More sharing options...
burpitt Posted July 6, 2011 Share Posted July 6, 2011 Hmm so possibly adding a second group would create the array perhaps? I'll test it in a mo... brekky first! Link to comment Share on other sites More sharing options...
burpitt Posted July 6, 2011 Share Posted July 6, 2011 Nope, extra groups did not fix this problemo! Getting 3 out the above debug errors now too.. so its erroring on every group perhaps? Link to comment Share on other sites More sharing options...
burpitt Posted July 6, 2011 Share Posted July 6, 2011 Right, a quick fix thanks to mr6 on the french IRC chat room... just edit the correct variables u need into phpmyadmin, thus bypassing the shodding presta SQL hookups wa-la! it works! messy but effective hope this helps someone else! feel free to pm me if anyone needs a hand with the phpmyadmin 1 Link to comment Share on other sites More sharing options...
NeilD Posted July 19, 2011 Share Posted July 19, 2011 Hi Paul, Can you tell me which tables/rows i have to edit in the prestashop database?I want to add free shipping to the Uk 1-3 working day delivery.Europe £8.50 5-10 working daysAll other international destinations £19.50 5-10 working daysAny help Muchly appreciatedCheersEDIT: Not to worry i found the part i needed to fix. I replaced the whole "ps_carrier" table with one from a fresh install of 1.4.3 via PHPmyadmin. Of course i now have to fill in the information for the carriers themselves but at least i can actually save.Hopefully thats helpful to someone. Let me know if anyone needs more details or if i just didnt really explain it very well and ill try and share what i found.Good luck Link to comment Share on other sites More sharing options...
burpitt Posted July 20, 2011 Share Posted July 20, 2011 Nice Neil, just going to test that fix right now... need to upload a whole presta tho to do so loooooong..... Link to comment Share on other sites More sharing options...
burpitt Posted July 21, 2011 Share Posted July 21, 2011 Update, Neil's fix of using a fresh ps_carrier table seems to work a treat! On analysis there are a few rows in there which aren't included in some of the older db's i guess. Maybe an oversight in the update process of not updating said table?Thanks for the fix Neil! Link to comment Share on other sites More sharing options...
nextgen4870 Posted September 12, 2011 Share Posted September 12, 2011 Hi all, I've the same problem as mentionned above : Warning: in_array() expects parameter 2 to be array, null given in /customers/7/4/9/n-e-d.be/httpd.www/admin/tabs/AdminCarriers.php on line 272 Warning: in_array() expects parameter 2 to be array, null given in /customers/7/4/9/n-e-d.be/httpd.www/admin/tabs/AdminCarriers.php on line 272 I tried to replace the file admincarriers with the one from PS1.4.4.1 but it does nothing. I understood that you replaced the whole ps_carrier table but don't know how to do this :-( Could you please help me with that point? Thanks in advance, Nextgen EDIT : My PS is PS 1.4.2.5 Link to comment Share on other sites More sharing options...
burpitt Posted September 14, 2011 Share Posted September 14, 2011 Hi nextgen, I didn't specifically recreate the tables, I just merely went through them using phpmyadmin to edit the sql DB to be holding the information that it needed as the main problem was the settings I was changing were not getting saved. So essentially you just have to manually edit it instead of using the presta back office GUI. Link to comment Share on other sites More sharing options...
extesy Posted February 10, 2012 Share Posted February 10, 2012 I also had this problem and finally figured out a solution after debugging prestashop. There's actually a bug in prestashop DB class. To fix the bug, open prestashop\classes\Db.php file, find autoexecute function and replace: foreach ($values AS $key => $value) $query .= '\'' . $value .'\','; with foreach ($values AS $key => $value) $query .= '\'' . (is_bool($value) ? ($value ? '1' : '0') : $value) .'\','; and foreach ($values AS $key => $value) $query .= '`'.$key.'` = \''.$value.'\','; with foreach ($values AS $key => $value) $query .= '`'.$key.'` = \''.(is_bool($value) ? ($value ? '1' : '0') : $value).'\','; Link to comment Share on other sites More sharing options...
extesy Posted February 10, 2012 Share Posted February 10, 2012 I have opened bug http://forge.prestashop.com/browse/PSCFI-4884 for this issue. Link to comment Share on other sites More sharing options...
mytrash Posted March 20, 2012 Share Posted March 20, 2012 Hello, this problem is still located in Prestashop 1.4.7.0. Myth Link to comment Share on other sites More sharing options...
Musilda Posted May 16, 2012 Share Posted May 16, 2012 Sorry for my english. I add into ps_carrier table - is_free tinyint(1) - default 0 This works. Link to comment Share on other sites More sharing options...
masquerade Posted January 11, 2016 Share Posted January 11, 2016 Hi! I'm not able to save carrier ranges in prestashop 1.6. Untile a few days ago it worked, now it's not working. The message is: An error occurred while saving carrier ranges. Anyone has some suggestions? Thank you Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now