1

Magento 1.9.2.3 Extension Causing error: Ameex Admin Activity Logger (Commerce Bees) Error in system.log - over and over again

Full error: ERR (3): Notice: Uninitialized string offset: 0 in /MyServerInfo/public_html/app/code/community/Ameex/Adminlog/Model/Observer.php on line 27

Code from line 27 of Observer.php:

$currentId = $request->getParam($dynamicValues[0]);

Full section of code that seems related to this error:

$adminlog = Mage::getModel('adminlog/adminlog');
        $dynamicValues = $this->_getDynamicValues($controllerName);
        $currentId = $request->getParam($dynamicValues[0]);
        $storeId =  $request->getParam('store');
        $store = Mage::getModel('core/store')->load($storeId);

Otherwise the extension seems to work fine, but I would like to stop this error occurring. First of all because I'm not sure what it could be doing that I don't see and because it's filling up my system.log file and I don't like errors. I contacted Extension creator, but there has been no response in several weeks. Any help would be appreciated.

1
  • Could you also add this function _getDynamicValues($controllerName). Feb 23, 2016 at 22:36

1 Answer 1

2

It is not an error, it is just a notice, you can ignore it.

Otherwise fix it in this way:

$currentId = count($dynamicValues) ? $request->getParam($dynamicValues[0]) : null;

Also try:

$currentId = isset($dynamicValues[0]) ? $request->getParam($dynamicValues[0]) : null;

You can also suppress notices in PHP by changing the error_reporting php ini value.

You probably have E_ALL. You can safely change it to E_ALL & ~E_NOTICE.

5
  • I haven't tried changing the error_reporting settings yet, but I tried the line of code you gave and nothing changed. Maybe I didn't understand what to do correctly? I simply went into the Observer.php file and took the line: $currentId = $request->getParam($dynamicValues[0]); and replaced it with: $currentId = count($dynamicValues) ? $request->getParam($dynamicValues[0]) : null; but I am still getting the exact same error.
    – Classic
    Feb 24, 2016 at 22:21
  • Also try isset($dynamicValues[0]) instead of count($dynamicValues) Feb 25, 2016 at 8:59
  • That stopped it. Not sure exactly what I did, but it works for now. I'll have to do some research and learn more about it, but thanks. I appreciate the help!
    – Classic
    Feb 26, 2016 at 22:08
  • Nothing special, it was just complaining because you where looking for something not exisiting. My code just said that if it does not exists you can cosider it as a null value. If it works for you pls accept the answer. Feb 26, 2016 at 22:09
  • I thought I had already. I hit the UP button next to the answer
    – Classic
    Feb 27, 2016 at 7:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.