How to Enable Symlinks After SUPEE-9767 V2 Install in Magento 1

magento-1supee-9767symlinks

Its seems SUPEE-9767v2 has disabled and removed the option in "Advanced -> Developer -> Template settings", that would allow us to enable/disable symlinks.

What is the other way to enable symlinks after V2 patch install?

Best Answer

You can only do it on DB at the moment.

1. SQL

Either ...

UPDATE core_config_data SET value = '1' WHERE path = 'dev/template/allow_symlink';

Or if entry does not exist ...

INSERT INTO core_config_data (config_id, scope, scope_id, path, value)
VALUES (NULL , 'default', '0', 'dev/template/allow_symlink', '1');

Note: Don't forget to add table prefix if you use one.

2. Script

Or run this from magento root ...

<?php
require_once('./app/Mage.php');
Mage::app();

Mage::getConfig()->saveConfig('dev/template/allow_symlink', '1', 'default', 0);

3. local.xml

Add another XML to app/etc/ directory like local.SUPEE-9767.xml to override local.xml.

<?xml version="1.0"?>
<config>
    <default>
        <dev>
            <template>
                <allow_symlink>1</allow_symlink>
            </template>
        </dev>
    </default>
</config>

4. "Module"

Create a mini "extension" with this system.xml to bring back config option to admin backend:

<?xml version="1.0"?>
<config>
    <sections>
        <dev>
            <groups>
                <template>
                    <show_in_default>1</show_in_default>
                    <fields>
                        <allow_symlink>
                            <show_in_default>1</show_in_default>
                            <backend_model>core/config_data</backend_model>
                        </allow_symlink>
                    </fields>
                </template>
            </groups>
        </dev>
    </sections>
</config>

Add an empty class for backend_model to enable save config value. Thanks to @colinmollenhour, instead of an empty class just reset backend model to parent.

Download: https://github.com/sreichel/magento-StackExchange_AllowSymlink

Related Topic