Magento 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.

  • Could you also add this function _getDynamicValues($controllerName). – Adarsh Khatri Feb 23 '16 at 22:36

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.

  • 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 '16 at 22:21
  • Also try isset($dynamicValues[0]) instead of count($dynamicValues) – Phoenix128_RiccardoT Feb 25 '16 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 '16 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. – Phoenix128_RiccardoT Feb 26 '16 at 22:09
  • I thought I had already. I hit the UP button next to the answer – Classic Feb 27 '16 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.