Archive: invalid argument supplied for foreach

 

Posts Tagged ‘invalid argument supplied for foreach’


Warning: Invalid argument supplied for foreach() in /myMagentoStore/trunk/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php on line 109 #0 /myMagentoStore/trunk/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php(109): mageCoreErrorHandler(2, ‘Invalid argumen…’, ‘/mnt/hgfs/Devel…’, 109, Array) #1 /myMagentoStore/trunk/app/code/core/Mage/Adminhtml/Block/Widget/Form.php(144): Mage_Adminhtml_Block_Urlrewrite_Edit_Form->_prepareForm() #2 /myMagentoStore/trunk/app/code/core/Mage/Core/Block/Abstract.php(757): Mage_Adminhtml_Block_Widget_Form->_beforeToHtml() #3 /myMagentoStore/trunk/app/code/core/Mage/Core/Block/Abstract.php(525): Mage_Core_Block_Abstract->toHtml() #4 /myMagentoStore/trunk/app/code/core/Mage/Core/Block/Abstract.php(472): Mage_Core_Block_Abstract->_getChildHtml(‘form’, true) #5 /myMagentoStore/trunk/app/design/adminhtml/default/default/template/urlrewrite/edit.phtml(38): Mage_Core_Block_Abstract->getChildHtml() #6 /myMagentoStore/trunk/app/code/core/Mage/Core/Block/Template.php(212): include(‘/mnt/hgfs/Devel…’) #7 /myMagentoStore/trunk/app/code/core/Mage/Core/Block/Template.php(239): Mage_Core_Block_Template->fetchView(‘adminhtml/defau…’) #8 /myMagentoStore/trunk/app/code/core/Mage/Core/Block/Template.php(253): Mage_Core_Block_Template->renderView() #9 /myMagentoStore/trunk/app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml() #10 /myMagentoStore/trunk/app/code/core/Mage/Adminhtml/Block/Widget/Container.php(295): Mage_Adminhtml_Block_Template->_toHtml() #11 /myMagentoStore/trunk/app/code/core/Mage/Core/Block/Abstract.php(758): Mage_Adminhtml_Block_Widget_Container->_toHtml() #12 /myMagentoStore/trunk/app/code/core/Mage/Core/Block/Text/List.php(43): [...]



 

I have 1.4 stable version with WYSIWYG. I have created a custom module with the module creator. I found the following code in the Form.php $fieldset->addField(’content’, ‘editor’, array( ‘name’ => ‘content’, ‘label’ => Mage::helper(’devtest’)->__(’Content’), ‘title’ => Mage::helper(’devtest’)->__(’Content’), ‘style’ => ‘width:700px; height:500px;’, ‘wysiwyg’ => false, ‘required’ => true, )); When i change ‘wysiwyg’ to true, the [...]



 

If you have this error when make the backup database in magento Warning: Invalid argument supplied for foreach() in /home/USERNAME/domains/DOMAINNAME/public_html/MAGENTOLOCATION/lib/Varien/Data/Collection/Filesystem.php on line 234 – go to line 234 on file : lib/Varien/Data/Collection/Filesystem.php – change this line : foreach (glob($folder . DIRECTORY_SEPARATOR . ‘*’) as $node) { with this : foreach ((array)glob($folder . DIRECTORY_SEPARATOR . ‘*’) [...]



 

 If you see this error:     Warning: Invalid argument supplied for foreach() in /home/USERNAME/domains/DOMAINNAME/public_html/MAGENTOLOCATION/lib/Varien/Data/Collection/Filesystem.php on line 234     – go to line 234 on file : lib/Varien/Data/Collection/Filesystem.php     – change this line :     foreach (glob($folder . DIRECTORY_SEPARATOR . ‘*’) as $node) {     with this :     foreach ((array)glob($folder . DIRECTORY_SEPARATOR . ‘*’) as [...]



 

If you see this error message when trying to access the backups section of Magento Admin: Warning: Invalid argument supplied for foreach() in /home/*****/public_html/lib/Varien/Data/Collection/Filesystem.php on line 234 Then this simple fix is for you: replace (line 24): PLAIN TEXT PHP: foreach (glob($folder . DIRECTORY_SEPARATOR . ‘*’) as $node) { with this: PLAIN TEXT PHP: foreach [...]



 

If you see this error message when trying to access the backups section of Magento Admin: Warning: Invalid argument supplied for foreach() in. Magento Backup Error Filesystem.php on line 234 + Solution … Possibly Related Posts: Magento Templates with Detailed Product Descriptions on Home … Magento Web Designer/Developer, Islamabad, World of Interiors Ltd Freelance Job [...]