Adding related products problem

Today I had a problem when I want to add related product to Magento Professional 1.9.0.0., it did not work. After some tracing thrown errors and comparing files with other Magento versions I found missing part. Magento Professional has missing lines of code in Related.php. So, if someone stuck on the same problem, here is the solution!
To correct this issue, do it in Magento way. So create your new module and rewrite that block. Here is the file where you can find these lines of code:
\app\code\core\Mage\Adminhtml\Block\Catalog\Product\Edit\Tab\Related.php
$this->addColumn('position', array(
'header' => Mage::helper('catalog')->__('Position'),
'name' => 'position',
'type' => 'number',
'validate_class' => 'validate-number',
'index' => 'position',
'width' => 60
));
to
$this->addColumn('position', array(
'header' => Mage::helper('catalog')->__('Position'),
'name' => 'position',
'type' => 'number',
'validate_class' => 'validate-number',
'index' => 'position',
'width' => 60,
'editable' => !$this->isReadonly(),
'edit_only' => !$this->_getProduct()->getId()
));
Enjoy debugging! 🙂
3 comments
OMG Andrew. >_>
@Andrew
This is not wrong. As I wrote “To correct this issue, do it in Magento way. So create your new module and rewrite that block.”
This is so wrong. You have modified core file, but thanks for the tip.