Magento-HHVM-Module-Compatibility icon indicating copy to clipboard operation
Magento-HHVM-Module-Compatibility copied to clipboard

Magento 1.8.1 backend not working properly after 20140514 builds

Open fcorriga opened this issue 11 years ago • 6 comments

As per title, after 20140514 nighlty magento backend doesnt work properly.

To reproduce: 1 - Go to Catalog->Products and try to filter by status or by visibility. No filtering happens. 2 - Enter a product and try to save it. It sais there are some mandatory fields even if they're selected.

Cause: Some

More details are following in the next post (testing).

fcorriga avatar May 19 '14 08:05 fcorriga

The problems are getOptionArray functions, with this hhvm version, not load options correctly like in this case:

Mage_Adminhtml_Block_Catalog_Product_Grid:

$this->addColumn('status',
        array(
            'header'=> Mage::helper('catalog')->__('Status'),
            'width' => '70px',
            'index' => 'status',
            'type'  => 'options',
            'options' => Mage::getSingleton('catalog/product_status')->getOptionArray(),
    ));

Mage_Catalog_Model_Product_Status:

const STATUS_ENABLED    = 1;
const STATUS_DISABLED   = 2;

/**
 * Retrieve option array
 *
 * @return array
 */
static public function getOptionArray()
{
    return array(
        self::STATUS_ENABLED    => Mage::helper('catalog')->__('Enabled'),
        self::STATUS_DISABLED   => Mage::helper('catalog')->__('Disabled')
    );
}

but we have this form select:

<select id="productGrid_product_filter_status" class="no-changes" name="status">
<option value=""></option> 
<option value="">Enabled</option>
<option value="">Disabled</option>
</select>

elachino avatar May 19 '14 08:05 elachino

the issue seems to be fixed with the latest 20140519 build

fcorriga avatar May 19 '14 15:05 fcorriga

The bug is again happening in another part of the backend: Configuration -> System Can't save since the Storage configuration for media "Filesystem" value is not populated (should be "0" instead of ""). This time even the 20140514 build doesn't work. Screenshot of the problem: http://www.webalice.it/f.corriga/temp/bug.jpeg

fcorriga avatar May 19 '14 16:05 fcorriga

To fix this bug we had to rewrite function _optionToHtml in lib/Varien/Data/Form/Element/Select.php, changed line 91, from

$html = '<option value="'.$this->_escape($option['value']).'"'; 

to

$html = '<option value="'.htmlspecialchars($option['value'],ENT_COMPAT).'"';

it is the same thing but the second works fine, like if it is a timing problem.

elachino avatar Jul 08 '14 14:07 elachino

Still not able to reproduce the bug, sorry :-(

You'll have to narrow it down to a smaller example before I can look at fixing it in HHVM.

danslo avatar Jul 08 '14 14:07 danslo

Hi Danslo, Sorry, we didn't see your post before. I've seen that in new hhvm version there is a "Fix substitution of invalid UTF8 sequences in htmlspecialchars", that thinks resolve it. We try and test it today.

elachino avatar Jul 24 '14 09:07 elachino