Post by bos_inc. » Sat Jul 16, 2016 8:04 pm

OpenCart 2.2.x.x

Since using opencart (few weeks..) everything works fine, except for the fact that my webserver doesn't support glob_brace.
I've read a lot about the problem, but can't find a workaround.

one of the error is in the image manager, but that one is solved.
The other one is when refreshing my modifications. It show's a fault page.

Code: Select all

Notice: Use of undefined constant GLOB_BRACE - assumed 'GLOB_BRACE' in /mnt/web015/b3/59/57275859/htdocs/admin/controller/extension/modification.php on line 179Warning: glob() expects parameter 2 to be long, string given in /mnt/web015/b3/59/57275859/htdocs/admin/controller/extension/modification.php on line 179Warning: Cannot modify header information - headers already sent by (output started at /mnt/web015/b3/59/57275859/htdocs/admin/controller/startup/error.php:34) in /mnt/web015/b3/59/57275859/htdocs/system/library/response.php on line 12
So i can't install a bunch of extensions, I think a lot of people are helped when there is a solution.

I am aware that i am using a Solaris webserver (strato), that doesn't support GLOB_BRACE... :(

I would be very thankful !

Newbie

Posts

Joined
Sat Jul 16, 2016 7:52 pm

Post by straightlight » Fri Jul 22, 2016 7:52 am

bos_inc. wrote:OpenCart 2.2.x.x

Since using opencart (few weeks..) everything works fine, except for the fact that my webserver doesn't support glob_brace.
I've read a lot about the problem, but can't find a workaround.

one of the error is in the image manager, but that one is solved.
The other one is when refreshing my modifications. It show's a fault page.

Code: Select all

Notice: Use of undefined constant GLOB_BRACE - assumed 'GLOB_BRACE' in /mnt/web015/b3/59/57275859/htdocs/admin/controller/extension/modification.php on line 179Warning: glob() expects parameter 2 to be long, string given in /mnt/web015/b3/59/57275859/htdocs/admin/controller/extension/modification.php on line 179Warning: Cannot modify header information - headers already sent by (output started at /mnt/web015/b3/59/57275859/htdocs/admin/controller/startup/error.php:34) in /mnt/web015/b3/59/57275859/htdocs/system/library/response.php on line 12
So i can't install a bunch of extensions, I think a lot of people are helped when there is a solution.

I am aware that i am using a Solaris webserver (strato), that doesn't support GLOB_BRACE... :(

I would be very thankful !
Your web server must be operating on SOLARIS system which GLOB_BRACE is not supported.

However, according to this post: https://github.com/symfony/symfony/issues/14502 , the following should resolved the issue:

In admin/controller/extension/modification.php file,

find:

Code: Select all

$files = glob($path, GLOB_BRACE);
replace with:

Code: Select all

$files = glob($path, (defined('GLOB_BRACE') ? GLOB_BRACE | GLOB_ONLYDIR : GLOB_ONLYDIR));
In admin/controller/common/filemanager.php file,

find:

Code: Select all

$files = glob($directory . '/' . $filter_name . '*.{jpg,jpeg,png,gif,JPG,JPEG,PNG,GIF}', GLOB_BRACE);
replace with:

Code: Select all

$files = glob($directory . '/' . $filter_name . '*.{jpg,jpeg,png,gif,JPG,JPEG,PNG,GIF}', (defined('GLOB_BRACE') ? GLOB_BRACE | GLOB_ONLYDIR : GLOB_ONLYDIR));
Optional:

In your install/model/upgrade/1006.php file,

find:

Code: Select all

$files = glob(DIR_OPENCART . '{config.php,*/config.php}', GLOB_BRACE);
replace with:

Code: Select all

$files = glob(DIR_OPENCART . '{config.php,*/config.php}', (defined('GLOB_BRACE') ? GLOB_BRACE | GLOB_ONLYDIR : GLOB_ONLYDIR));
This should rectify the problem. The GLOB_BRACE should only be used when SOLARIS servers are not involved.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Bromanfs » Sat Nov 25, 2017 10:49 pm

Just create the module which fix this issue.
https://www.opencart.com/index.php?rout ... n_id=32541

Newbie

Posts

Joined
Fri Jun 30, 2017 4:45 pm

Post by sgt_spike » Sat Mar 02, 2019 8:59 pm

This solution worked for me. The error went away, however the drop downs don't populate. When I need to change an image for a category or product nothing shows up in the popup to allow an image to be chosen. Has this issue been addressed?

Just to be clear, I don't have a Solaris webserver.

Attachments

opencart.PNG

opencart.PNG (25.21 KiB) Viewed 3978 times


Newbie

Posts

Joined
Sat Mar 02, 2019 4:13 am

Post by straightlight » Sun Mar 03, 2019 12:09 am

sgt_spike wrote:
Sat Mar 02, 2019 8:59 pm
This solution worked for me. The error went away, however the drop downs don't populate. When I need to change an image for a category or product nothing shows up in the popup to allow an image to be chosen. Has this issue been addressed?

Just to be clear, I don't have a Solaris webserver.
Error logs?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: Semrush [Bot] and 38 guests