Announcement

#1 2018-09-05 14:27:24

UnConundrum
Member
2018-09-05
3

SyntaxError: JSON Parse error: Unrecognized token '<'

Hello/Hi/Greetings,

New user, new install on Ubuntu 18.04.  When I go to create a new/first album, after clicking on "Create" I get the following error:

SyntaxError: JSON Parse error: Unrecognized token '<'



Piwigo version: latest version
PHP version: 7.2
MySQL version: 8.01
Piwigo URL: http://.  Not exposed to web as of now.

Offline

 

#2 2018-09-09 14:46:05

UnConundrum
Member
2018-09-05
3

Re: SyntaxError: JSON Parse error: Unrecognized token '<'

Doesn't anyone have a suggestion for me?

Offline

 

#3 2018-09-09 21:47:37

flop25
Piwigo Team
2006-07-06
7037

Re: SyntaxError: JSON Parse error: Unrecognized token '<'

you have a silent error, use the Dev console F12 to display the content of the JSOn call, in Network tab


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#4 2018-09-09 23:47:35

UnConundrum
Member
2018-09-05
3

Re: SyntaxError: JSON Parse error: Unrecognized token '<'

I don't see a JSON call, but could it be related to the sql error where "rank", "status", and "name" needing to be put into back-tics? (reported at [Github] Piwigo issue #919)

The only error I do see is the sql error:

<pre><br />
<b>Warning</b>:  [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rank,global_rank,commentable,visible,status)
  VALUES('Family','0','0','true','t' at line 2

INSERT INTO piwigo_categories
  (name,rank,global_rank,commentable,visible,status)
  VALUES('Family','0','0','true','true','public') in <b>/var/www/html/piwigo/include/dblayer/functions_mysqli.inc.php</b> on line <b>845</b><br />
</pre><pre><br />
<b>Warning</b>:  [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ', global_rank
  FROM piwigo_categories
  ORDER BY id_uppercat,rank,name' at line 1

SELECT id, id_uppercat, uppercats, rank, global_rank
  FROM piwigo_categories
  ORDER BY id_uppercat,rank,name in <b>/var/www/html/piwigo/include/dblayer/functions_mysqli.inc.php</b> on line <b>845</b><br />
</pre><br />
<b>Fatal error</b>:  Uncaught Error: Call to a member function fetch_assoc() on boolean in /var/www/html/piwigo/include/dblayer/functions_mysqli.inc.php:226
Stack trace:
#0 /var/www/html/piwigo/admin/include/functions.php(658): pwg_db_fetch_assoc(false)
#1 /var/www/html/piwigo/admin/include/functions.php(1516): update_global_rank()
#2 /var/www/html/piwigo/include/ws_functions/pwg.categories.php(574): create_virtual_category('Family', 0, Array)
#3 /var/www/html/piwigo/include/ws_core.inc.php(608): ws_categories_add(Array, Object(PwgServer))
#4 /var/www/html/piwigo/include/ws_protocols/rest_handler.php(56): PwgServer-&gt;invoke('pwg.categories....', Array)
#5 /var/www/html/piwigo/include/ws_core.inc.php(296): PwgRestRequestHandler-&gt;handleRequest(Object(PwgServer))
#6 /var/www/html/piwigo/ws.php(94): PwgServer-&gt;run()
#7 {main}
  thrown in <b>/var/www/html/piwigo/include/dblayer/functions_mysqli.inc.php</b> on line <b>226</b><br />

Offline

 

#5 2018-09-10 19:19:37

flop25
Piwigo Team
2006-07-06
7037

Re: SyntaxError: JSON Parse error: Unrecognized token '<'

it sounds like it's the "reserved word" issue indeed


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

Board footer

Powered by FluxBB

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