Configuration > Features & Options > Layout
When I click Layout, it crashes. Hmm...
Linux?
Windows?
PHP version?
Some "special" setting?
The only potentially peculiar thing that the page does is scan a few directories for controllers, so it's either a problem with win VS lin file structure or some php extension not working the way it is supposed to. I guess.
Linux. PHP 5.6 (tried on 5.4 as well, crashes too).
Not sure what you mean by "Special Setting" though.. :/
Edit: Woops, I thought you were asking for my own computer's OS. Updated to "Linux" instead. :p
/me has to fire up wamp on the laptop... :'( <= it takes ages on the poor thing!! :'( :'(
T.T Sorry, it's Linux, not Windows.
Heck.
I hoped it was windows because at least it gave me something to work on...
Could you check the permissions are all set correctly? (Maybe you have some file around in the controllers or addons directories that has a wrong permission/owner?)
All the files in Controllers & Addons are 644. Is that correct?
Ok, let's try to pinpoint the issue.
Could you open sources/admin/ManageFeatures.controller.php search for the line:
$config_vars = getFrontPageControllers();
and change it to:
$config_vars = array();
Wow it worked! :D :D :D
Nice job!
No, that's not a fix, it's just to confirm where the issue is.
Now, restore that line the way it was.
Open sources/subs/ManageFeatures.subs.php, close to the end there is this block:
$glob = new GlobIterator(CONTROLLERDIR . '/*.controller.php', FilesystemIterator::SKIP_DOTS);
$classes += scanFileSystemForControllers($glob);
$glob = new GlobIterator(ADDONSDIR . '/*/controllers/*.controller.php', FilesystemIterator::SKIP_DOTS);
$classes += scanFileSystemForControllers($glob, '\\ElkArte\\Addon\\');
Try commenting it out and see if you can reach the page.
// $glob = new GlobIterator(CONTROLLERDIR . '/*.controller.php', FilesystemIterator::SKIP_DOTS);
// $classes += scanFileSystemForControllers($glob);
// $glob = new GlobIterator(ADDONSDIR . '/*/controllers/*.controller.php', FilesystemIterator::SKIP_DOTS);
// $classes += scanFileSystemForControllers($glob, '\\ElkArte\\Addon\\');
Alright done! It works once it's commented out.
So yeah good luck in your next step... 8)
Restore the commented code and comment out only the first pair of lines:
$glob = new GlobIterator(CONTROLLERDIR . '/*.controller.php', FilesystemIterator::SKIP_DOTS);
$classes += scanFileSystemForControllers($glob);
Yup it still works.
Now, just to double check: restore the two commented lines and comment out the other two.
Just to reduce confusion (because I'm not sure myself what I wrote LOL), the final code should look like:
$glob = new GlobIterator(CONTROLLERDIR . '/*.controller.php', FilesystemIterator::SKIP_DOTS);
$classes += scanFileSystemForControllers($glob);
// $glob = new GlobIterator(ADDONSDIR . '/*/controllers/*.controller.php', FilesystemIterator::SKIP_DOTS);
// $classes += scanFileSystemForControllers($glob, '\\ElkArte\\Addon\\');
Oh jeez.. it crashed. Error 500. :p
So yup those two lines are the culprit :@
Good.
Now, let's assume the iterator is fine and it crashes at some point during the scanning.
Try changing:
foreach ($iterator as $file)
{
$class_name = $namespace . preg_replace('~([^^])((?<=)[A-Z](?=[a-z]))~', '$1_$2', $file->getBasename('.controller.php')) . '_Controller';
to:
foreach ($iterator as $file)
{
echo $glob->getFilename() . '<br>';
Errors::instance()->log_error($file->getFilename());
$class_name = $namespace . preg_replace('~([^^])((?<=)[A-Z](?=[a-z]))~', '$1_$2', $file->getBasename('.controller.php')) . '_Controller';
it we are lucky the last showed/logged is the problematic file.
If you don't see anything accessing the page, try looking in the error log.
Notice: Undefined variable: glob
@ index.php?action=admin;area=featuresettings;sa=layout;PGafAYj35W=da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
File:
/sources/subs/ManageFeatures.subs.php
Line: 845
Here you go!
Sorry, my typo:
echo $glob->
should be:
$file->
Well.. well.. well..
A whole boatload of errors:
Today at 02:42:15 PM
da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Type of error: General
Markasread.controller.php
index.php?action=admin;area=featuresettings;sa=layout;PGafAYj35W=da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Today at 02:42:15 PM
da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Type of error: General
MarkRead.controller.php
index.php?action=admin;area=featuresettings;sa=layout;PGafAYj35W=da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Today at 02:42:15 PM
da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Type of error: General
Likes.controller.php
index.php?action=admin;area=featuresettings;sa=layout;PGafAYj35W=da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Today at 02:42:15 PM
da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Type of error: General
Karma.controller.php
index.php?action=admin;area=featuresettings;sa=layout;PGafAYj35W=da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Today at 02:42:15 PM
da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Type of error: General
Jslocale.controller.php
index.php?action=admin;area=featuresettings;sa=layout;PGafAYj35W=da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Today at 02:42:15 PM
da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Type of error: General
Help.controller.php
index.php?action=admin;area=featuresettings;sa=layout;PGafAYj35W=da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Today at 02:42:15 PM
da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Type of error: General
Groups.controller.php
index.php?action=admin;area=featuresettings;sa=layout;PGafAYj35W=da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Today at 02:42:15 PM
da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Type of error: General
Emailuser.controller.php
index.php?action=admin;area=featuresettings;sa=layout;PGafAYj35W=da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Today at 02:42:15 PM
da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Type of error: General
Emailpost.controller.php
index.php?action=admin;area=featuresettings;sa=layout;PGafAYj35W=da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Today at 02:42:15 PM
da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Type of error: General
Draft.controller.php
index.php?action=admin;area=featuresettings;sa=layout;PGafAYj35W=da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Today at 02:42:15 PM
da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Type of error: General
Display.controller.php
index.php?action=admin;area=featuresettings;sa=layout;PGafAYj35W=da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Today at 02:42:15 PM
da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Type of error: General
Calendar.controller.php
index.php?action=admin;area=featuresettings;sa=layout;PGafAYj35W=da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Today at 02:42:15 PM
da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Type of error: General
BoardIndex.controller.php
index.php?action=admin;area=featuresettings;sa=layout;PGafAYj35W=da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Today at 02:42:15 PM
da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Type of error: General
Auth.controller.php
index.php?action=admin;area=featuresettings;sa=layout;PGafAYj35W=da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Today at 02:42:15 PM
da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Type of error: General
Attachment.controller.php
index.php?action=admin;area=featuresettings;sa=layout;PGafAYj35W=da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Today at 02:42:15 PM
da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Type of error: General
Announce.controller.php
index.php?action=admin;area=featuresettings;sa=layout;PGafAYj35W=da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
Type of error: General
Markasread.controller.php
index.php?action=admin;area=featuresettings;sa=layout;PGafAYj35W=da9ffq3mkmmGqEg5JrbzNz2lHhGTBRny
This is is.
Markasread.controller.php has been "recently" renamed to Markread.controller.php, so the file left in place is crashing the system.
I'd consider indeed that a bug.
The "quick fix" is to simply delete the file.
Oooh.. I see.. So all I need to do is to delete "Markasread.controller.php" under Sources/Controller, right?
Alright, done and it works as expected! :D Nice!