BUG? Extra brackets getting added to concrete.php overrides
Permalink
V8.2...
Every so often the site goes down totally and I have to look in the Apache error log to find the issue which unless I've broken something is usually:
With the issue being extra array brackets being added into concrete.php. I'm not touching this file at all (except to delete these brackets.
The only thing manipulating this file is this in the package controller
I did a package upgrade today when I added a block to it but I couldn't say that package updates consistently caused this issue. It's happen maybe 3-4 times over the course of building this package (3 months) though there's not one specific thing I could say causes this to happen.
Should this be logged as a bug or am I doing something wrong somehow? Thought it best to run it past the community before logging it.
Every so often the site goes down totally and I have to look in the Apache error log to find the issue which unless I've broken something is usually:
With the issue being extra array brackets being added into concrete.php. I'm not touching this file at all (except to delete these brackets.
69 'enabled' => true, 70 'validate_email' => false, 71 'notification' => null, 72 'notification_email' => false, 73 ], 74 ], 75 ]; 76 ], <------------- these 77 ], <------------- 78 ]; <-------------
The only thing manipulating this file is this in the package controller
public function on_start() { \Route::setThemeByRoute('/login', 'tog_main'); \Route::setThemeByRoute('/register', 'tog_main'); \Route::setThemeByRoute('/page_not_found', 'tog_main'); \Route::setThemeByRoute('/dashboard/welcome', 'tog_main'); // override dash RHS panel $objEnv = Environment::get(); $objEnv->overrideCoreByPackage('elements/panels/dashboard.php', $this); $objEnv->overrideCoreByPackage('views/panels/add.php', $this); // // override marketplace, welcome popup, etc \Config::save('concrete.marketplace.enabled', false); \Config::save('concrete.marketplace.intelligent_search', false); \Config::save('concrete.external.intelligent_search_help', false); \Config::save('concrete.external.news_overlay', false);
Viewing 15 lines of 17 lines. View entire code block.
I did a package upgrade today when I added a block to it but I couldn't say that package updates consistently caused this issue. It's happen maybe 3-4 times over the course of building this package (3 months) though there's not one specific thing I could say causes this to happen.
Should this be logged as a bug or am I doing something wrong somehow? Thought it best to run it past the community before logging it.
Sorry, please disregard my previous post, I misunderstood what was happening. I deleted it.
This happened to met today, except in the application/config/generated_overrides/app.php - concrete5 seems to have added and extra:
To the array that's generated and caused the site to crash. I have no idea why this is happening. Only occurs every once and a while. I've also had it happen on one other site as well. I tried to figure out why but had no luck. Any ideas?
);
To the array that's generated and caused the site to crash. I have no idea why this is happening. Only occurs every once and a while. I've also had it happen on one other site as well. I tried to figure out why but had no luck. Any ideas?
Just happened again on another production site, bringing it down completely. Last line of the php file had the closing square brackets duplicated and needed to be deleted.
I assume the install and upgrade methods of the package controller don't get run every time, just the on_start() which in my case contains some defines plus:
I assume the install and upgrade methods of the package controller don't get run every time, just the on_start() which in my case contains some defines plus:
\Config::save('concrete.email.validate_registration.address', 'noreply@mysite.co.uk'); \Config::save('concrete.email.validate_registration.name', 'My site name'); \Route::setThemeByRoute('/login', 'debs'); \Route::setThemeByRoute('/register', 'debs'); \Route::setThemeByRoute('/page_not_found', 'debs'); \Route::setThemeByRoute('/dashboard/welcome', 'debs'); \Route::setThemeByRoute('/login/callback/concrete/email_validated', 'debs');
I just posted a bug report as it seems to need addressing still.
https://www.concrete5.org/developers/bugs/8-4-2/extra-square-bracket...
https://www.concrete5.org/developers/bugs/8-4-2/extra-square-bracket...
Things like this are best reported as issues on GitHub. Bug reports on this site have a very low profile while issues do get attention.
Have we found a solution yet for this? I have been experiencing the exact same issue.
Sadly, I can't find where, but someone did post a solution that worked for me. Essentially, if you are calling Config::save in a package on_start method is causes a race condition which leads to this issue. Instead, use Config::set and the problem should go away.
I would see if you can find a pattern and document the steps to reproduce the issue.
On a test setup, install and uninstall the package repeatedly to see when, and if, the issue occurs.