<commit_before><?php


use VinaiKopp\PostCodeFilter\Query\RuleResult;
use VinaiKopp\PostCodeFilter\UseCases\AdminViewsRuleList;

class VinaiKopp_PostCodeFilter_Block_Adminhtml_Postcodefilter_Grid
    extends Mage_Adminhtml_Block_Widget_Grid
{
    protected $_pagerVisibility = false;
    protected $_filterVisibility = false;

    /**
     * @var mixed[]
     */
    private $currentItemParams;

    protected function _prepareCollection()
    {
        $collection = new Varien_Data_Collection();
        $this->addRuleItemsToCollection($collection);
        $this->setCollection($collection);
        return parent::_prepareCollection();
    }

    public function getRowUrl($item)
    {
        /** @var Varien_Object $item */
        $this->currentItemParams = [
            'country' => $item->getData('country'),
            'customer_group_ids' => implode(',', $item->getData('customer_groups')),
        ];
        return $this->getUrl('*/*/edit', $this->currentItemParams);
    }

    protected function _prepareColumns()
    {
        $this->addColumn('country', [
            'header' => $this->__('Country'),
            'width' => '80px',
            'index' => 'country',
            'filter' => false,
            'sortable' => false,
        ]);
        $this->addColumn('customer_groups', [
            'header' => $this->__('Customer Groups'),
            'index' => 'customer_groups',
            'type' => 'options',
            'options' => $this->getCustomerGroupsOptions(),
            'filter' => false,
            'sortable' => false,
        ]);
        $this->addColumn('post_codes', [
            'header' => $this->__('Allowed Post Codes'),
            'index' => 'post_codes',
            'type' => 'options',
            'options' => ['required-dummy'],
            'show_missing_option_values' => true,
            'filter' => false,
            'sortable' => false,
        ]);
        $this->addColumn('action',
            array(
                'header' => $this->__('Action'),
                'width' => '50px',
                'type' => 'action',
                'getter' => 'getCountry',
                'actions' => array(
                    array(
                        'caption' => $this->__('Edit'),
                        'url' => array(
                            'base' => '*/*/edit',
                            'params' => $this->currentItemParams
                        ),
                        //'field' => 'country'
                    )
                ),
                'filter' => false,
                'sortable' => false,
                'index' => 'stores',
            ));
        return parent::_prepareColumns();<commit_msg>Turns out the 'field' property is required after all<commit_after><?php


use VinaiKopp\PostCodeFilter\Query\RuleResult;
use VinaiKopp\PostCodeFilter\UseCases\AdminViewsRuleList;

class VinaiKopp_PostCodeFilter_Block_Adminhtml_Postcodefilter_Grid
    extends Mage_Adminhtml_Block_Widget_Grid
{
    protected $_pagerVisibility = false;
    protected $_filterVisibility = false;

    /**
     * @var mixed[]
     */
    private $currentItemParams;

    protected function _prepareCollection()
    {
        $collection = new Varien_Data_Collection();
        $this->addRuleItemsToCollection($collection);
        $this->setCollection($collection);
        return parent::_prepareCollection();
    }

    public function getRowUrl($item)
    {
        /** @var Varien_Object $item */
        $this->currentItemParams = [
            'country' => $item->getData('country'),
            'customer_group_ids' => implode(',', $item->getData('customer_groups')),
        ];
        return $this->getUrl('*/*/edit', $this->currentItemParams);
    }

    protected function _prepareColumns()
    {
        $this->addColumn('country', [
            'header' => $this->__('Country'),
            'width' => '80px',
            'index' => 'country',
            'filter' => false,
            'sortable' => false,
        ]);
        $this->addColumn('customer_groups', [
            'header' => $this->__('Customer Groups'),
            'index' => 'customer_groups',
            'type' => 'options',
            'options' => $this->getCustomerGroupsOptions(),
            'filter' => false,
            'sortable' => false,
        ]);
        $this->addColumn('post_codes', [
            'header' => $this->__('Allowed Post Codes'),
            'index' => 'post_codes',
            'type' => 'options',
            'options' => ['required-dummy'],
            'show_missing_option_values' => true,
            'filter' => false,
            'sortable' => false,
        ]);
        $this->addColumn('action',
            array(
                'header' => $this->__('Action'),
                'width' => '50px',
                'type' => 'action',
                'getter' => 'getCountry',
                'actions' => array(
                    array(
                        'caption' => $this->__('Edit'),
                        'url' => array(
                            'base' => '*/*/edit',
                            'params' => $this->currentItemParams
                        ),
                        'field' => 'country'
                    )
                ),
                'filter' => false,
                'sortable' => false,
                'index' => 'stores',
            ));
        return parent::_prepareColumns();
{'fraction_non_alphanumeric': 0.15220195319697807, 'fraction_numerical': 0.0014741109268472453, 'mean_word_length': 1.6752094627895515, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 105, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '834609', 'n_tokens_mistral': 1467, 'n_tokens_neox': 1430, 'n_words': 247}