Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade grav 1.7.30 and 1.7.29 servr error 500 #3542

Closed
NandoPiz opened this issue Feb 21, 2022 · 3 comments
Closed

Upgrade grav 1.7.30 and 1.7.29 servr error 500 #3542

NandoPiz opened this issue Feb 21, 2022 · 3 comments

Comments

@NandoPiz
Copy link

Hi, I’ve an issue during the grav upgrade form version 1.7.25 to version 1.7.30
aftrer the upgrade I receive server error 500.
I’ve done many test and the issue start with versione 1.7.29. I mean until version 1.7.28 all works well but with version 1.7.29 I receive error 500 from server.

The test was done with Open Publishing Space skeleton.
I’ve check error 500 and no problem with .htaccess
Checking the change log from version 1.7.29 I can see:

Added unicode-safe Utils::basename() and Utils::pathinfo() methods
Improved Filesystem::basename() and Filesystem::pathinfo() to be unicode-safe
Made path handling unicode-safe, use new Utils::basename() and Utils::pathinfo() everywhere

If I look in the logs directory I can see grav.log file (see attachment)

In order to solve the issue I've changed

system\src\Grav\Common\Assets.php file on line 201
from:
$extension = Utils::pathinfo(parse_url($asset, PHP_URL_PATH), PATHINFO_EXTENSION);

to

$extension = pathinfo(parse_url($asset, PHP_URL_PATH), PATHINFO_EXTENSION);

I've removed Utils::

error.txt

I didn't understand if this is a bug or problem related to my environment

regards

@NandoPiz
Copy link
Author

I found the issue:
In the config file user\config\system.yaml
I0ve the following config:

assets:
js_module_pipeline_before_excludes: true
js_minify: true
enable_asset_timestamp: false
enable_asset_sri: false
collections:
jquery :
- 'system://assets/jquery/jquery-2.x.min.js'
- 'user://sweetalert2.all.min.js'
- 'user://jquery.cookiebar.js'

with this config the Utils::pathinfo return "NULL" that is not accepetd. I need to keep all 3 js. Any suggestion

@mahagr
Copy link
Member

mahagr commented Feb 22, 2022

@NandoPiz I made the methods less strict, but the issue is that some of the files doesn't exist, which causes the method to return false.

Please try CI build, it should work.

@mahagr mahagr closed this as completed Feb 22, 2022
@pamtbaau
Copy link
Contributor

@NandoPiz, Please feedback this solution into your Discourse issue and mark that reply as 'solution'.

mahagr added a commit that referenced this issue Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants