quickapps / cms

Modular CMS powered by CakePHP
GNU General Public License v3.0
164 stars 69 forks source link

Cannot access backoffice anymore (with last updates (?)) #120

Closed Gabri closed 9 years ago

Gabri commented 9 years ago

Hello,

Some days ago I've tried to update a qacms local website with composer. It updated it (after that I had some problems with permission files, but it seemed ok, no errors on updating). But from that moment I couldn't access backoffice anymore. I tried a new fresh installation just now ...nothing, these are the errors (in errors.log):

2015-08-24 09:39:50 Error: Fatal Error (1): Call to undefined method Cake\View\ViewBuilder::viewPath() in [/opt/gabri/Web/ial2/tmp/aop/ial2/vendor/cakephp/cakephp/src/Controller/Controller.php, line 350]
Trace:
Cake\Error\BaseErrorHandler::handleFatalError() - CORE/src/Error/BaseErrorHandler.php, line 192
Cake\Error\BaseErrorHandler::Cake\Error\{closure}() - CORE/src/Error/BaseErrorHandler.php, line 91
[main] - [internal], line ??

2015-08-24 09:39:50 Error: [Cake\Error\FatalErrorException] Call to undefined method Cake\View\ViewBuilder::viewPath()
Request URL: /ial2/en_US/login
Stack Trace:
#0 /opt/gabri/Web/ial2/vendor/cakephp/cakephp/src/Error/BaseErrorHandler.php(91): Cake\Error\BaseErrorHandler->handleFatalError(1, 'Call to undefin...', '/opt/gabri/Web/...', 350)
#1 [internal function]: Cake\Error\BaseErrorHandler->Cake\Error\{closure}()
#2 {main}

After a fresh installatinon the "administer your site" like at the end of installation process call the page '/ial2/en_US/admin' and I get 404: The requested address '/ial2/en_US/admin' was not found on this server.

Instead the errors reported above is for the url '/ial2/en_US/login' (calling the 'Sign in' link in the dropdown menu in the top right).

Problems are just mine?

Thanks

quickapps commented 9 years ago

Hi, Sounds like a cache problem, have you tried removing /tmp/aop directory? (actually try removing recursively everything within /tmp

Gabri commented 9 years ago

Tried. Same result. I don't think it could be a permission problem of filesystem (but I don't exclude at 100%. I updated and checked it, they seems good) ?

quickapps commented 9 years ago

Oh I see,

I think it is related to CakePHP. Looking closer the error message you've provided: Cake\View\ViewBuilder::viewPath() ...that class belongs to CakePHP 3.1 branch.

Try altering your "composer.json" file: https://github.com/quickapps/cms/blob/2.0/composer.json#L21

For instance, change "~3.0" to just "3.0.12"

Gabri commented 9 years ago

I tried with 3.0.12, 3.0.11, 3.0.10... but nothing, same result. Probably a stupid question, but calling composer update from /vendor/quickapps/cms (i can see the updating of cakephp/cakephp) should change sources on /vendor/cakephp/cakephp? /vendor/cakephp/cakphp seems on version 3.1.0-beta2. Another thing strange to me is... I downloaded zip sources from https://github.com/cakephp/cakephp/tags from different versions ...but I cannot find one with class file ViewBuilder.php (namespace Cake\View)... File that I have on /vendors/cakephp/cakephp/src/View (?).

Maybe the problem I encountered is related to https://github.com/cakephp/cakephp/pull/7237

Thanks for your time

quickapps commented 9 years ago

First you should edit the composer.json file as described before. BUT then you should call composer from /ROOT directory, that is where you can find webroot and this other file.

You should never call composer within /vendor, also you can update cakephp only as follow:

$ cd /opt/gabri/Web/ial2/
$ composer update cakephp/cakephp

CakePHP's ViewBuilder.php belongs to branch 3.1 which still under development (beta-2), this particular file was added after beta-2 release, that is why you can't find this file in any tagged version.

As QACMS still under development its "minimum-stability" is currently set to DEV, that is why running composer update will cause to download CakePHP dev branches as well.

This commit 2a51e7b91b260d48d5e0ae14b7fd4113c8149eee should solve this and similar problems.

Regards

Gabri commented 9 years ago

Thank you very much, now it's clear (and it works!)

Little note: surely you saw it, there is a warning updating QACMS:

Package lisachenko/go-aop-php is abandoned, you should avoid using it. Use goaop/framework instead.