Fall- Posted May 16, 2022 Share Posted May 16, 2022 (edited) Hello guys, I have an error API related when i try to use PrestaSharp and i don't know what the problem is. Maybe you have an idea what to do. Prestashop version: 1.7.8.0 PHP Version: 7.4.29 <message><![CDATA[[PHP Notice #8] Trying to access array offset on value of type null (/home/horticol/public_html/classes/Product.php, line 7141)]]></message> Here is the entire code: id: 11 application/xml: <prestashop> <product> <id>11</id> <id_manufacturer>56</id_manufacturer> <id_supplier>2</id_supplier> <id_category_default>5</id_category_default> <cache_default_attribute>26</cache_default_attribute> <id_default_image>13</id_default_image> <id_default_combination>26</id_default_combination> <id_tax_rules_group>0</id_tax_rules_group> <position_in_category>2</position_in_category> <type>simple</type> <id_shop_default>1</id_shop_default> <reference>E2358-14.5-0.1500-60P</reference> <supplier_reference></supplier_reference> <location></location> <width>0.000000</width> <height>0.000000</height> <depth>0.000000</depth> <weight>0.300000</weight> <quantity_discount>0</quantity_discount> <ean13></ean13> <upc></upc> <isbn></isbn> <cache_is_pack>0</cache_is_pack> <cache_has_attachments>1</cache_has_attachments> <is_virtual>0</is_virtual> <additional_delivery_times>1</additional_delivery_times> <delivery_in_stock> <language id="2"></language> </delivery_in_stock> <delivery_out_stock> <language id="2"></language> </delivery_out_stock> <state>1</state> <on_sale>0</on_sale> <online_only>0</online_only> <ecotax>0.000000</ecotax> <minimal_quantity>1</minimal_quantity> <low_stock_alert>0</low_stock_alert> <price>18.1176</price> <wholesale_price>0.000000</wholesale_price> <unity></unity> <unit_price_ratio>0.000000</unit_price_ratio> <additional_shipping_cost>0.000000</additional_shipping_cost> <customizable>0</customizable> <text_fields>0</text_fields> <uploadable_files>0</uploadable_files> <active>1</active> <redirect_type>301-category</redirect_type> <id_type_redirected>0</id_type_redirected> <available_for_order>1</available_for_order> <available_date>0000-00-00</available_date> <show_condition>0</show_condition> <condition>new</condition> <show_price>1</show_price> <indexed>1</indexed> <visibility>both</visibility> <advanced_stock_management>0</advanced_stock_management> <pack_stock_type>3</pack_stock_type> <meta_description> <language id="2"></language> </meta_description> <meta_keywords> <language id="2"></language> </meta_keywords> <meta_title> <language id="2"></language> </meta_title> <link_rewrite> <language id="2">hummingbird-cushion</language> </link_rewrite> <name> <language id="2">Atasamente</language> </name> <description> <language id="2"><p>The hummingbird cushion will add a graphic and colorful touch to your sofa, armchair or bed. Create a modern and zen atmosphere that inspires relaxation. Cover 100% cotton, machine washable at 60° / Filling 100% hypoallergenic polyester.</p></language> </description> <description_short> <language id="2"><p>Cushion with removable cover and invisible zip on the back. 32x32cm</p></language> </description_short> <available_now> <language id="2"></language> </available_now> <available_later> <language id="2"></language> </available_later> <associations> <categories> <category> <id>2</id> </category> <category> <id>5</id> </category> <category> <id>6</id> </category> <category> <id>8</id> </category> </categories> <images> <image> <id>13</id> </image> <image> <id>14</id> </image> </images> <combinations> <combinations> <id>26</id> </combinations> <combinations> <id>27</id> </combinations> </combinations> <product_option_values> <product_option_value> <id>8</id> </product_option_value> <product_option_value> <id>11</id> </product_option_value> </product_option_values> <product_features> <product_feature> <id>1</id> <id_feature_value>1</id_feature_value> </product_feature> <product_feature> <id>2</id> <id_feature_value>9</id_feature_value> </product_feature> </product_features> <tags /> <stock_availables> <stock_available> <id>11</id> <id_product_attribute>0</id_product_attribute> </stock_available> <stock_available> <id>45</id> <id_product_attribute>26</id_product_attribute> </stock_available> <stock_available> <id>46</id> <id_product_attribute>27</id_product_attribute> </stock_available> </stock_availables> <product_bundle /> <accessories /> </associations> </product> </prestashop> ws_key: ZI7IC5XT7KLABTBXFAJZ95LG342AMYQ1 <?xml version="1.0" encoding="UTF-8"?> <prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> <errors> <error> <code><![CDATA[5]]></code> <message><![CDATA[[PHP Notice #8] Trying to access array offset on value of type null (/home/horticol/public_html/classes/Product.php, line 7141)]]></message> </error> </errors> </prestashop> HttpStatusCode: InternalServerError Obiect in format JSON: JSON Blob | 975732576962756608 Thank you! Edited May 16, 2022 by Fall- (see edit history) 1 Link to comment Share on other sites More sharing options...
abdullacm Posted May 17, 2022 Share Posted May 17, 2022 is this a default prestashop or upgraded from 1.6 or older 1.7 to 1.7.8.0? Link to comment Share on other sites More sharing options...
Fall- Posted May 17, 2022 Author Share Posted May 17, 2022 (edited) Hello, Is default prestashop 1.7.8.0. Is not upgraded. Here is the code from product.php line 7141. } // result is indexed by recordset order and not position. positions start at index 1 so we need an empty element array_unshift($result, null); foreach ($result as &$value) { $value = $value['id_product']; } Edited May 17, 2022 by Fall- (see edit history) Link to comment Share on other sites More sharing options...
Fall- Posted July 1, 2022 Author Share Posted July 1, 2022 Any help please? Link to comment Share on other sites More sharing options...
vanessa_adabra Posted September 5, 2022 Share Posted September 5, 2022 I am having the same issue. did you figure it out? Link to comment Share on other sites More sharing options...
aruiz0922 Posted September 12, 2022 Share Posted September 12, 2022 (edited) Same problem here. Prestashop 1.7.8.6 PHP 7.4.28 While try to get many blank schemas like orders or customers returns the next error: Status: 500Internal Server Error <message> <![CDATA[[PHP Notice #8] Trying to access array offset on value of type null (/var/www/kit1/classes/webservice/WebserviceOutputBuilder.php, line 719)]]> </message> Edited September 12, 2022 by aruiz0922 (see edit history) Link to comment Share on other sites More sharing options...
vanessa_adabra Posted September 13, 2022 Share Posted September 13, 2022 @aruiz0922, In my case the issue was a field that was valued as boolean while it was supposed to be an integer. In this situation on the array returned you should be able to view the errors as well. 1 Link to comment Share on other sites More sharing options...
aruiz0922 Posted September 14, 2022 Share Posted September 14, 2022 Thanx for the response. In my case the error comes while getting some blank schemas about 15 of them. Think I'm goin to make a new post for my problem Link to comment Share on other sites More sharing options...
JCV Posted December 26, 2022 Share Posted December 26, 2022 Hello aruiz0922, Have you found solution for errors with blank page ? I upgraded to lastest version and I've got the same problem. Quote <error> <code>5</code> <message> [PHP Notice #8] Trying to access array offset on value of type null (/home/xxxxxxx/public_html/classes/webservice/WebserviceOutputBuilder.php, line 716) </message> </error> Link to comment Share on other sites More sharing options...
aruiz0922 Posted December 27, 2022 Share Posted December 27, 2022 17 hours ago, JCV said: Hello aruiz0922, Have you found solution for errors with blank page ? I upgraded to lastest version and I've got the same problem. If your problem comes while getting the blank schemas, my solution was to download the blank xml schemas to a folder and read the schemas from there. Link to comment Share on other sites More sharing options...
pitertin Posted March 29, 2023 Share Posted March 29, 2023 Hi, I have same problem (Prestashop 1.7.8.8, PHP 7.4.30) on line 7149 of /classes/Product.php. A solution is to change the line like this: $value = (isset($value['id_product']) ? $value['id_product'] : null); 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