Fatal error: Undefined class constant 'FORM_KEY' -- Magento - php

After upgrading from Magento ver. 1.7.0.2 to 1.9.2.0 I've run intop a error and can't find a solution anywhere.
The error is:
Fatal error: Undefined class constant 'FORM_KEY' in \app\code\core\Mage\Checkout\Helper\Cart.php on line 67
No other errors in system.log, exception.log or php error.log. Just this error printout on the page.
How can I fix this?

The class constant is Mage_Core_Model_Url::FORM_KEY and did not exist yet in Magento 1.7
If you use the Magento compiler active (you shouldn't, see: when should I use the Magento compiler), recompile. If you use an opcode cache like APC, flush it.
But most likely the issue is that you made a copy of this class in app/code/local/Mage/Core/Model/Url.php to hack some changes into it. Check what you changed there, replace it with the new file from app/code/core/Mage/Core/Model/Url.php and re-apply your changes1.
1. Even better, don't put anything in app/code/local/Mage and user proper class rewriting

Related

Undefined index: Magento\Framework\App\State with NewRelic module in Magento 2.2.6

I have 2 modules that uses Plugins for Magento\Framework\App\State::afterSetAreaCode
Whenever both of the modules are enabled Magento throws:
1 exception(s):
Exception #0 (Exception): Notice: Undefined index:
Magento\Framework\App\State in /vendor/magento/framework/Interception/PluginList/PluginList.php on line 250
I've followed the code and came to conclusion that the fault seems to be a Magento\NewRelicReporting\Plugin\StatePlugin::afterSetAreaCode. This modules and method is calling retrieving some configuration values.
Somehow, retrieving the values load additional configuration files and resets Magento\Framework\Interception\PluginList\PluginList::_pluginInstances list which then returns error when next plugin in List in Magento\Framework\Interception\Interceptor tries to call getPlugin method.
This seems to happen only when cache is clear, once it's populated the site seems to work, but obviously it's not going to work correctly.
Has anyone ever encountered such issues?

Drupal - Fatal error sessionhandler

I am receiving following errors when I try to access pages and the site becomes inaccessible(error 500).
PHP Fatal error: Class Drupal\Core\Database\Statement contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Drupal\Core\Database\StatementInterface::fetchObject) in /projects/core/lib/Drupal/Core/Database/Statement.php on line 16
PHP Fatal error: Class Drupal\Core\Session\SessionHandler contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (SessionHandlerInterface::read) in /projects/core/lib/Drupal/Core/Session/SessionHandler.php on line 15
Restarting server will solve the issue for a limited time. Just found it was a memory issue. changed the memory_limit to 128, 256 and 512 but really seems to have happen randomly while browsing my website
Apache/2.4.29, PHP 7.0.26
Hey just need to delete cache or run drupal cron. for more details, please go to following the link.
https://www.drupal.org/project/drupal/issues/2668564
Hope it will useful for you.

Function edited but still error in Prestashop

i've tried to install a module in Prestashop called COD with fee.
On install i received this message:
Fatal error: Access level to Inix2Module::displayWarning() must be public (as in class ModuleCore) in /home/lw1m2hta/public_html/test/ingrosso2/modules/inixframe/InixModule.php on line 3792
[PrestaShop] Fatal error in module file :/home/lw1m2hta/public_html/test/ingrosso2/modules/inixframe/InixModule.php:
Access level to Inix2Module::displayWarning() must be public (as in class ModuleCore)
So i tried to solve this problem as suggested by other people in presta forum and i went to the line and changed "protected" function to "public". The problem is that i still have the fatal error displaying in my site.
I really don't understand why prestashop doesn't check the edit. Is there a solution?

Drupal failed after update

I just updated Drupal core from 7.4 to 7.26. After running update.php site stopped working – both public and admin part. When I load it fatal error occurs:
Fatal error: Call to undefined function _system_default_theme_features() in /[drupal_path]/includes/theme.inc on line 1422
and when I reload it another fatal error apperars:
Fatal error: Call to a member function getDirectoryPath() on a non-object in /[drupal_path]/modules/image/image.module on line 83
next reload – first error, one more – second. Also, second error is loading much faster.
And one more thing, after applaying update.php I got one failed, I don't know if this is connected:
media_gallery module
Update #7009
Failed: FieldException: Próba aktualizacji egzemplarza nieistniejącego pola media_gallery_media. w field_update_instance() (linia 557 z /[drupal_path]/modules/field/field.crud.inc).
which is something like:
Failed: FieldException: Attempt to update an instance of a nonexistent field media_gallery_media. in field_update_instance() (line 557 in /[drupal_path]/modules/field/field.crud.inc).
PHP Version 5.5.6
Any tips where the problem is? I was trying disabling some modules from db, but this did't help.
It's difficult to explain the reason and to provide a solution.
My attempt would be to copy the DB and the files on a neutral platform (local machine or so) and experiment with the update.php script.
My suspicion would be that media module needs also update since it's using the old URI function definition (call). Also try to update other modules that are working with files.
The update is quite big since 7.4 to 7.22 (years of improvement). Reading the change log would be helpful but not realistic.
Did you also cleared the cache? (via drush if the web interface not working - /?q=admin/config/development/performance)
Please don't forget to post the solution if you find one for other users with the same issue.

I get a fatal error after attempting to install wp-ecommerce plugin, can not find any other support with same error

I attempted to install a wp-ecommerce plugin, it gave me this fatal error and now it only shows the fatal error message when I try to access my wp-admin.
Fatal error: Cannot redeclare class wpsc_gateways in /home4/stickdog/public_html/wp-content/plugins/wp-e-commerce/wpsc-components/merchant-core-v2/classes/wpsc-gateways.php on line 6
If I can access my file manager and I just delete the plugin will it solve my problem? I would rather use the plugin but if it won't work its ok. Thanks for your help.
From a programming perspective it seems like the PHP class wpsc_gateways is being redeclared in the coding. But since this is a pre-packaged plug-in that seems odd. Perhaps sloppy coding on the part of the original author. If you delete the plugin the problem will be solved. But maybe the plug-in was installed twice by accident? Look at the contents if your /home4/stickdog/public_html/wp-content/plugins/ to see if that might have happened.

Categories