We are randomly and intermittently getting the following error on our home page using cs-cart 4.5.2SP2.
Any suggestions? I have no idea what Pimple is or what it is used for. Refreshing the page [F5] always gets rid of the error.
-->
Posted 12 February 2018 - 04:50 PM #1
We are randomly and intermittently getting the following error on our home page using cs-cart 4.5.2SP2.
Any suggestions? I have no idea what Pimple is or what it is used for. Refreshing the page [F5] always gets rid of the error.
-->
Posted 12 February 2018 - 05:23 PM #2
I have no idea what Pimple is or what it is used for. Refreshing the page [F5] always gets rid of the error.
Buy CS-Cart License | CS-Cart Hosting
.
CS-Cart VPS SSD Cloud Hosting from $4,90/month *** Dedicated Servers *** CS-Cart Authorized Reseller and Web Hosting Provider
Posted 12 February 2018 - 05:56 PM #3
Hello,
This would require server-side investigation. Contact either the CS-Cart helpdesk or feel free to contact us at info@poppedweb.com
Best wishes,
Posted 12 February 2018 - 05:57 PM #4
Yes, I see what pimple is, but what does the error mean and how to correct?
Posted 12 February 2018 - 05:58 PM #5
Yes, I see what pimple is, but what does the error mean and how to correct?
Like I said, we can't see from here. We need to know which add-ons you have, what core modifications you have done, PHP version, etc.
Posted 12 February 2018 - 08:59 PM #6
From the stack trace provided, it is trying to retrieve the current template "view" from the registry but for some reason it is undefined.
As @popedweb states, it must be investigated on your server since 1) it is intermittent (which means sometimes it works and sometimes doesn't) and 2) That is is probably NOT related to the registry at all, but rather to the template engine itself. There is probably a different error ahead of this one in your error_log that will probably point more directly to the actual problem rather than the symptom.
EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.
Posted 13 February 2018 - 12:27 AM #8
Posted 13 February 2018 - 01:01 AM #9
OK, I think I found the cause. Now how to fix.
I have some modified code in fn.cart.php that says
if (strlen($arrive['3'])>1) {Registry::get('view')->assign('arrive3', $arrive['3']);}
It appears for some reason, sometimes 'view' is not defined and Registry::get('view') is throwing an error.
Why?
and I have
use Tygh\Registry;
Posted 13 February 2018 - 01:50 AM #10
Generally a Registry::get('something") will return false if "something" is not set. You can use an ifGet(value, default) but then what would you do if it's not set?
So the reason it's not set is most likely that you are trying to reference the 'view' before the templater is initialized (which is where the 'view' is set). Are you doing this in an addon? Addons init.,php files are usually run AFTER all the standard init() routines are performed. If you're modifying distributed code then you are probably trying to reference it before the templater is initialized.
Suggest you verify at what point in the page loading process you are getting the 'view'.
To help any further, would need more detail on what/how you're doing what you are doing.
EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.
Posted 13 February 2018 - 02:07 AM #11
Yes, I believe you are correct about the templater getting initialized, but weird how the error is very intermittent.
Its for an addon, but I modified the app/functions/fn.cart.php directly in order to pass some variables. It all works fine (has been for years), but very intermittently we get this view error.
In fn.cart.php (around line 3325), I added:
foreach ($group['shippings'] as $shipping_id => $shipping) { // if ($shipping_id == 40) {continue 1;} // DAVID MOD FOR ARRIVE DATE //echo $shipping_id.'<br>'; $arrive = arriveDate($shipping_id); //call function and pass in $shipping_id // Assign smarty variables to PHP array indexes if (strlen($arrive['3'])>1) {Registry::get('view')->assign('arrive3', $arrive['3']);} if (strlen($arrive['11'])>1) {Registry::get('view')->assign('arrive11', $arrive['11']);} if (strlen($arrive['12'])>1) {Registry::get('view')->assign('arrive12', $arrive['12']);} if (strlen($arrive['13'])>1) {Registry::get('view')->assign('arrive13', $arrive['13']);} //GROUND BY ZONES if (strlen($arrive['111'])>1) {Registry::get('view')->assign('zone1', $arrive['111']);} if (strlen($arrive['112'])>1) {Registry::get('view')->assign('zone2', $arrive['112']);} if (strlen($arrive['113'])>1) {Registry::get('view')->assign('zone3', $arrive['113']);} if (strlen($arrive['114'])>1) {Registry::get('view')->assign('zone4', $arrive['114']);} if (strlen($arrive['115'])>1) {Registry::get('view')->assign('zone5', $arrive['115']);} // END DAVID MOD FOR ARRIVE DATE
Posted 13 February 2018 - 02:19 AM #12
Posted 13 February 2018 - 06:03 PM #13
Unfortunately we have seen the error once today. So my fix didn't help.
It does appear to be the Admin who sees it the most when switching to Frontend. Can it be related to the Admin logging in with multiple accounts or acting on behalf of? We are not sure if customers are seeing the intermittent error.
David
Posted 13 February 2018 - 06:10 PM #14
Hello,
The only thing I could think of is that you have created / edited an order and then decide to view the admin panel (without a user session --> sid_customer_*) thus causing this bug (because it will try and calculate the cart of the admin perhaps?).
Kind regards,
Posted 13 February 2018 - 06:52 PM #15
I can guess till the cows come home.
Best practice would be never modify core files. Always use addons. If you need to modify a core file, do it as a hook and then make a hook request in the developer area (sticky post). Never do anything in an addon's config.php file that expects other areas of the system to be initialized (I.e. init follows config).
EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.
Posted 20 October 2018 - 04:51 PM #16
I can guess till the cows come home.
Best practice would be never modify core files. Always use addons. If you need to modify a core file, do it as a hook and then make a hook request in the developer area (sticky post). Never do anything in an addon's config.php file that expects other areas of the system to be initialized (I.e. init follows config).
I have also started to see this error, very intermitant only since updating to the latest version of CS-cart
Alan
Posted 08 January 2020 - 02:49 PM #17
I'm getting this also using a 3rd party addon we need working, very frustrating as they are saying it's CS Carts fault...
Any more ideas or how anyone above resolved this?
#0 /home/cctvkits/public_html/app/Tygh/Registry.php(105): Pimple\Container->offsetGet('view') #1 /home/cctvkits/public_html/app/addons/product_package_builder/func.php(366): Tygh\Registry::get('view') #2 /home/cctvkits/public_html/app/functions/fn.control.php(120): fn_product_package_builder_get_product_data(63, '?:products.*, ?...', ' LEFT JOIN ?:pr...', Array, 'en', ' AND (companies...') #3 /home/cctvkits/public_html/app/functions/fn.catalog.php(181): fn_set_hook('get_product_dat...', 63, '?:products.*, ?...', ' LEFT JOIN ?:pr...', Array, 'en', ' AND (companies...') #4 /home/cctvkits/public_html/app/addons/product_package_builder/func.php(686): fn_get_product_data(63, Array, 'en', '?:products.*, ?...', true, true, true, true) #5 /home/cctvkits/public_html/app/functions/fn.control.php(120): fn_product_package_builder_get_o
Posted 08 January 2020 - 11:09 PM #18
Hello
This addon has no producer support? Does this addon have open code or is it encoded?
Best regards
Robert
Team of SoftSolid
cs-cart.pl, marketplace
We specialize in creating the highest quality addons, safe, useful and flexible
Posted 09 January 2020 - 05:12 AM #19
I'm getting this also using a 3rd party addon we need working, very frustrating as they are saying it's CS Carts fault...
Any more ideas or how anyone above resolved this?
It is hard to say anything without detailed code examination
Posted 11 January 2020 - 12:10 PM #20
Hi and thanks - they are looking at it now but it is hard to recreate the issue reliably. It's not encoded. They have setup logging on the dev store apparently. Thought logs were under var/log but don't seem to have such a directory?