magento-hackathon / magento-composer-installer

Composer installer for Magento modules
210 stars 154 forks source link

Not valid template file:frontend/mytheme_rwd/default/template/page/1column.phtml #193

Open csdougliss opened 9 years ago

csdougliss commented 9 years ago

Hi,

I have setup magento-composer-installer to share a theme from a separate private repo to a couple of other repos. I have run:

./composer.phar install in the root of my magento install.

When viewing the site I see the following error:

2015-06-18T08:11:31+00:00 CRIT (2): Not valid template file:frontend/mytheme_rwd/default/template/page/1column.phtml

The symlinks were created as such:

in app/design/frontend: mytheme_rwd -> ../../../vendor/xxx/module-theme-mytheme/app/design/frontend/mytheme_rwd

In skin/frontend: mytheme_rwd -> ../../vendor/xxx/module-theme-mytheme/skin/frontend/mytheme_rwd

The composer.json of the repo that I am pulling is configured as such:

{
  "name": "xxx/module-theme-mytheme",
  "type": "magento-module",
  "extra": {
    "map": [
        ["app/design/frontend/mytheme_rwd", "app/design/frontend/mytheme_rwd"],
        ["skin/frontend/mytheme_rwd", "skin/frontend/mytheme_rwd"]
      ]
  },
  "license":"proprietary",
  "description":"theme",
  "authors":[
    {
      "name":"Craig,
      "email":"craig_carnell@hotmail.com"
    }
  ]
}

I am using git version 2.4.3. Composer is 1.0-dev (b2173d28fc8b56236eddc8aa10dcda61471633ec) 2015-06-16 10:43:55

nginx is 1.8.0 and Varnish is 4.0.3. OS is OS X 10.10.3 Yosemite

Any ideas?

AydinHassan commented 9 years ago

Do you have symlinks enabled in Magento Admin?

System -> Configuration -> Developer -> Template Settings

csdougliss commented 9 years ago

@AydinHassan No I didnt. That has fixed my local copy thanks!

But on deployment (we use capistrano (magentify) with jenkins) - is there any way to not use symlinks so I do not need to enable this option?

AydinHassan commented 9 years ago

You can use the copy deploy strategy

csdougliss commented 9 years ago

@AydinHassan

With local development, I would prefer to symlink so that you can still edit the files in php storm and commit them back.

If you are referring to "magento-deploystrategy": "copy", I presume this will stop me doing this?

With capistrano I am using the copy strategy:

set :copy_via,         :scp
set :deploy_via,       :copy
set :deploy_to,        '/var/www/vhosts/xxx_uk'
set :copy_strategy,    :export
set :copy_exclude,     [".git/*", "var/*"]

Capistrano is v2

AydinHassan commented 9 years ago

Yeah you can't do this. We just use composer extra to grab config, there is no way to specify dev/production configss for composer. Why can't you just use symlinks for production? We do.

csdougliss commented 9 years ago

@AydinHassan I've read it's a security risk

AydinHassan commented 9 years ago

Well you are using Capistrano, which uses symlinks...

Take it with a pinch of salt, but do research in to it.

Flyingmana commented 9 years ago

actually yes, symlinks are a security risk. There were already some problems with apache a while ago. For them most of it was fixable by using the symlinksifownermatch directive instead of the FollowSymLinks For Magento this is not so easy, on the other side there are a lot lot of people using Magento with allowed symlinks without attacks targeting this.

Maybe we should add a new Feature, which allows environment specific decisions here. But that could cause problems to not appear before a deploy.

I have another feature planed, which makes symlinks/copy not needed anymore, but its not likely to get added during the next weeks