Announcement

#1 2019-08-21 11:51:13

glujaz
Member
2019-08-21
5

No menu working

Hello/Hi/Greetings, (yeah, I leave that for fun !)

I'm having issues with my piwigo page. no menu is working now, letting me not even access to the admin panel. I assume it's a javascript issue or something. I even tried a manual update, but nothing solved the problem. Any idea to solve this ?

Thanks in advance !

Piwigo version: 2.9.5
PHP version: 7.3
MySQL version: 5.6
Piwigo URL: http://photos.spaceup.fr

Offline

 

#2 2019-08-21 14:24:19

erAck
Only trying to help
2015-09-06
2023

Re: No menu working

Browsing your site, if you look in the Firefox Web Console (Shift+Ctrl+K) you'll see two error messages

SyntaxError: expected expression, got '<'
in view-source:https://photos.spaceup.fr/_data/combined/y4xflf.js position 327:17

likely is the culprit, the other

ReferenceError: $ is not defined
in view-source:https://photos.spaceup.fr/ position 439:1

probably only because the y4xflf.js didn't load properly.

Now that '<' character is the start of the <br /> element that was injected along with the following Deprecated message, which all invalidates the JavaScript source. You probably should step down from PHP 7.3 to PHP 7.1 as more quirks may be lurking, or if that is not possible try to set

$conf['show_php_errors'] = E_ALL & ~E_DEPRECATED;

in your Piwigo's local/config/config.inc.php


Running Piwigo at https://erack.net/gallery/

Offline

 

#3 2019-08-21 17:10:28

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: No menu working

In addtion to erAck findings, I understand it is related to incompatibility between jshrink and PHP 7.3. This should have been fixed in Piwigo 2.9.5, see [Github] Piwigo issue #988

My question is then "do you really have the modified file include/jshrink.class.php ?" do you have these changes [Github] Piwigo commit 15d8a198 ?

Offline

 

#4 2019-08-21 18:17:42

glujaz
Member
2019-08-21
5

Re: No menu working

Ok, i will try it as son as possible thanks.

For your information, I had php7.1 and the problem was there too. I tried to change to 7.3 after I saw this error...

Offline

 

#5 2019-08-21 18:34:18

erAck
Only trying to help
2015-09-06
2023

Re: No menu working

Make sure the cached file gets regenerated when switching versions (Piwigo or PHP), and if only by manually removing it. If nothing helps you could also try to edit the cached file and remove the trailing crap, though it would get regenerated on the next occasion it might work a while until the cause is found.


Running Piwigo at https://erack.net/gallery/

Offline

 

#6 2019-08-21 19:07:08

glujaz
Member
2019-08-21
5

Re: No menu working

Ok, so I tried to change the file, but it does not exists…
I also revert back to php7.1, and cleared the cache, and that did Nothing else to… Any Idea now ?
I can't even access to the admin panel as the login is done via a menu...

Offline

 

#7 2019-08-22 11:07:32

erAck
Only trying to help
2015-09-06
2023

Re: No menu working

Certainly the file does exist, otherwise it couldn't be served.. in your Piwigo installation there's _data/combined/y4xflf.js

Also, visiting the page now outputs the
$conf['show_php_errors'] = E_ALL & ~E_DEPRECATED;
followed by some warnings. Likely that is the only line in the local/config/config.inc.php file so it's not interpreted as PHP. Have at least

Code:

<?php
$conf['show_php_errors'] = E_ALL & ~E_DEPRECATED;
?>

Running Piwigo at https://erack.net/gallery/

Offline

 

#8 2019-08-22 14:11:59

glujaz
Member
2019-08-21
5

Re: No menu working

Ok, sorry, but I'm definitly lost. I am not a developper. I found the problematic file, tried to remove some stuff, but Nothing helped.

Can you tell me precisly what I have to do ? I would thank you very much for that :)

And thanks for the error. I corrected it :)

Last edited by glujaz (2019-08-22 14:12:28)

Offline

 

#9 2019-08-22 14:48:26

erAck
Only trying to help
2015-09-06
2023

Re: No menu working

The last two lines read

Code:

return colorStr;}<br />
<b>Deprecated</b>:  strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in <b>/home/spaceup/www_piwigo/include/jshrink.class.php</b> on line <b>195</b><br />;

Remove everything including and after the first <br /> so the last line reads

Code:

return colorStr;}

Also you could answer plg's question by inspecting the file include/jshrink.class.php and see if line 195 reads

Code:

                    if($this->b !== false && strpos('(-+{[@', $this->b) !== false)

If not, then you probably don't run Piwigo 2.9.5 or something went astray during an upgrade.


Running Piwigo at https://erack.net/gallery/

Offline

 

#10 2019-08-22 15:00:54

glujaz
Member
2019-08-21
5

Re: No menu working

Thanks !

I modified as you said, cleared the cache, and now it works fine. Had to edit multiple files though, as the one you mentioned wasn't the only one having these lines… After a successful connection, another file was doing the same javascript problem.


For the request, I checked, and the line is here as you can see in the attached screen capture.

I hope it's now solved. And if it starts again, I now know how to solve it, so thanks ! :)

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact