Announcement

#1 2017-05-02 19:56:51

Chartman123
Member
2017-04-11
7

[resolved] Can't show user details after update to 2.9.0

Hello,

I've got a little problem after updating to version 2.9.0. Everything works fine except the users list in the backend. When I want to modify a user, the popup comes up but only shows the text "loading". The user details only show up for the guest user.

Piwigo version: 2.9.0
PHP version: 7.1.4
MySQL version: 5.7.18
Piwigo URL: http://

Please tell me what other information you need to resolve my issue :)

Best regards and congrats to this (except for this one little thing) smooth new version,

Chris

Offline

 

#2 2017-05-03 18:44:49

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

Re: [resolved] Can't show user details after update to 2.9.0

Hi Chartman123,

Maybe the database upgrade did not apply correctly.

What does this SQL query returns on your database?

Code:

select * from piwigo_upgrade order by applied desc limit 10;

and this one:

Code:

select * from piwigo_config where param like '%version%';

and this one:

Code:

show create table piwigo_user_infos;

Offline

 

#3 2017-05-03 20:51:13

Chartman123
Member
2017-04-11
7

Re: [resolved] Can't show user details after update to 2.9.0

Hi plg,

thanks for the quick response... Here are the results from the queries:

Code:

select * from piwigo_upgrade order by applied desc limit 10;

151  2017-05-02 19:18:23  [migration from 2.8.0 to 2.9.0, 0.001 s] add "picture_sizes_icon" and "index_sizes_icon" parameters
149  2017-05-02 19:18:23  [migration from 2.8.0 to 2.9.0, 0.030 s] add last_visit+last_visit_from_history in user_infos table
152  2017-05-02 19:18:23  [migration from 2.8.0 to 2.9.0, 0.003 s] add 5 parameters to show/hide icons (edit/caddie/repressentative)
150  2017-05-02 19:18:23  [migration from 2.8.0 to 2.9.0, 0.214 s] add history_id_from+history_id_to in history_summary table
148  2016-03-08 18:54:14  [migration from 2.7.0 to 2.8.0, 0.583 s] add auth_key_id in history table
147  2016-03-08 18:54:13  [migration from 2.7.0 to 2.8.0, 0.006 s] add user authentication keys table
146  2016-03-08 18:54:13  [migration from 2.7.0 to 2.8.0, 0.805 s] add format_id in history table
145  2016-03-08 18:54:12  [migration from 2.7.0 to 2.8.0, 0.008 s] add image formats table
101  2015-03-11 19:59:11  upgrade included in installation
104  2015-03-11 19:59:11  upgrade included in installation

Code:

select * from piwigo_config where param like '%version%';

'piwigo_db_version', '2.9', NULL

Code:

show create table piwigo_user_infos;

'CREATE TABLE `piwigo_user_infos` (
  `user_id` mediumint(8) unsigned NOT NULL DEFAULT \'0\',
  `nb_image_page` smallint(3) unsigned NOT NULL DEFAULT \'15\',
  `status` enum(\'webmaster\',\'admin\',\'normal\',\'generic\',\'guest\') NOT NULL DEFAULT \'guest\',
  `language` varchar(50) NOT NULL DEFAULT \'en_UK\',
  `expand` enum(\'true\',\'false\') NOT NULL DEFAULT \'false\',
  `show_nb_comments` enum(\'true\',\'false\') NOT NULL DEFAULT \'false\',
  `show_nb_hits` enum(\'true\',\'false\') NOT NULL DEFAULT \'false\',
  `recent_period` tinyint(3) unsigned NOT NULL DEFAULT \'7\',
  `theme` varchar(255) NOT NULL DEFAULT \'elegant\',
  `registration_date` datetime NOT NULL DEFAULT \'0000-00-00 00:00:00\',
  `enabled_high` enum(\'true\',\'false\') NOT NULL DEFAULT \'true\',
  `level` tinyint(3) unsigned NOT NULL DEFAULT \'0\',
  `activation_key` varchar(255) DEFAULT NULL,
  `activation_key_expire` datetime DEFAULT NULL,
  `lastmodified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `oauth_id` varchar(255) DEFAULT NULL,
  `last_visit` datetime DEFAULT NULL,
  `last_visit_from_history` enum(\'true\',\'false\') NOT NULL DEFAULT \'false\',
  PRIMARY KEY (`user_id`),
  KEY `lastmodified` (`lastmodified`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8'

Offline

 

#4 2017-05-04 12:43:48

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

Re: [resolved] Can't show user details after update to 2.9.0

That's very strange, because you're running MySQL 5.7 so I expected you would have the same problem as [Forum, post 167402 by tomass in topic 27923] Errors after upgrade to 2.9 but in your case the column piwigo_user_infos.last_visit was created! So I don't know what can be the problem.

Next test: with your web browser (Firefox or Chrome), open the console  and when you open the user edit box you should see an HTTP request. This request certainly returns an error, I need to know which one :-)

Offline

 

#5 2017-05-04 13:04:40

Chartman123
Member
2017-04-11
7

Re: [resolved] Can't show user details after update to 2.9.0

Code:

VM128:2 Uncaught SyntaxError: Unexpected token < in JSON at position 1
    at JSON.parse (<anonymous>)
    at Function.m.parseJSON (jquery.min.js?v2.9.0:5)
    at Object.success (admin.php?page=user_list:749)
    at j (jquery.min.js?v2.9.0:2)
    at Object.fireWith [as resolveWith] (jquery.min.js?v2.9.0:2)
    at x (jquery.min.js?v2.9.0:5)
    at XMLHttpRequest.b (jquery.min.js?v2.9.0:5)
m.parseJSON  @  jquery.min.js?v2.9.0:5
success  @  admin.php?page=user_list:749
j  @  jquery.min.js?v2.9.0:2
fireWith  @  jquery.min.js?v2.9.0:2
x  @  jquery.min.js?v2.9.0:5
b  @  jquery.min.js?v2.9.0:5

This was the first error I saw. I'll send you the HTTP log later, as I'm at work now ;)

Offline

 

#6 2017-05-04 13:13:26

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

Re: [resolved] Can't show user details after update to 2.9.0

Chartman123 wrote:

Unexpected token < in JSON at position 1

It certainly means you have an error returned by Piwigo in HTML. I need to know what Piwigo replied (the response) to the HTTP query.

Offline

 

#7 2017-05-04 16:36:17

Chartman123
Member
2017-04-11
7

Re: [resolved] Can't show user details after update to 2.9.0

This is the response:

Code:

<br />
<b>Fatal error</b>:  Uncaught Error: [] operator not supported for strings in C:\inetpub\wwwroot\piwigo\include\ws_functions\pwg.users.php:198
Stack trace:
#0 C:\inetpub\wwwroot\piwigo\include\ws_core.inc.php(608): ws_users_getList(Array, Object(PwgServer))
#1 C:\inetpub\wwwroot\piwigo\include\ws_protocols\rest_handler.php(56): PwgServer-&gt;invoke('pwg.users.getLi...', Array)
#2 C:\inetpub\wwwroot\piwigo\include\ws_core.inc.php(296): PwgRestRequestHandler-&gt;handleRequest(Object(PwgServer))
#3 C:\inetpub\wwwroot\piwigo\ws.php(94): PwgServer-&gt;run()
#4 {main}
  thrown in <b>C:\inetpub\wwwroot\piwigo\include\ws_functions\pwg.users.php</b> on line <b>198</b><br />

Offline

 

#8 2017-05-04 18:58:46

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

Re: [resolved] Can't show user details after update to 2.9.0

OK. Do you understand this fix:

Code:

diff --git a/include/ws_functions/pwg.users.php b/include/ws_functions/pwg.users.php
index 1a55fcf..31d2159 100644
--- a/include/ws_functions/pwg.users.php
+++ b/include/ws_functions/pwg.users.php
@@ -149,11 +149,6 @@ SELECT DISTINCT ';
     else $first = false;
     $query.= $field .' AS '. $name;
   }
-  if (isset($params['display']['groups']))
-  {
-    if (!$first) $query.= ', ';
-    $query.= '"" AS groups';
-  }
 
   if (isset($display['ui.last_visit']))
   {
@@ -179,6 +174,10 @@ SELECT DISTINCT ';
   while ($row = pwg_db_fetch_assoc($result))
   {
     $row['id'] = intval($row['id']);
+    if (isset($params['display']['groups']))
+    {
+      $row['groups'] = array(); // will be filled later
+    }
     $users[ $row['id'] ] = $row;
   }

If yes, can you try it?

Offline

 

#9 2017-05-04 23:42:57

Chartman123
Member
2017-04-11
7

Re: [resolved] Can't show user details after update to 2.9.0

Yes, I know how to apply this ;)

And yes, it fixes my problem :) Thank you!

Offline

 

Board footer

Powered by FluxBB

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