Json formatting error due to extra PHP notices #476

Closed
opened 2026-10-05 00:00:18 +02:00 by adam · 9 comments
Owner

Hi, when I hit the user admin screen I receive this message:
DataTables warning (table id = 'userList'): DataTables warning: JSON data from server could not be parsed. This is casued by a JSON formatting error.

Looking at the ajax call I see that user_list_backend.php is displaying some PHP notices that break the JSON:


Notice: Undefined index: sSearch in /srv/troyvit.com/pics/admin/user_list_backend.php on line 102

Notice: Undefined variable: sOrder in /srv/troyvit.com/pics/admin/user_list_backend.php on line 142

Notice: Undefined index: sEcho in /srv/troyvit.com/pics/admin/user_list_backend.php on line 164

I think I can suppress the PHP notices, but I wanted to let you know that out of the box this happens.

This is after a recent upgrade to 2.8.2

Best,

Troy Vitullo
piwigo

Hi, when I hit the user admin screen I receive this message: DataTables warning (table id = 'userList'): DataTables warning: JSON data from server could not be parsed. This is casued by a JSON formatting error. Looking at the ajax call I see that user_list_backend.php is displaying some PHP notices that break the JSON: <br /> <b>Notice</b>: Undefined index: sSearch in <b>/srv/troyvit.com/pics/admin/user_list_backend.php</b> on line <b>102</b><br /> <br /> <b>Notice</b>: Undefined variable: sOrder in <b>/srv/troyvit.com/pics/admin/user_list_backend.php</b> on line <b>142</b><br /> <br /> <b>Notice</b>: Undefined index: sEcho in <b>/srv/troyvit.com/pics/admin/user_list_backend.php</b> on line <b>164</b><br /> I think I can suppress the PHP notices, but I wanted to let you know that out of the box this happens. This is after a recent upgrade to 2.8.2 Best, Troy Vitullo <img width="1280" alt="piwigo" src="https://cloud.githubusercontent.com/assets/2042893/17181929/0f950978-53df-11e6-8870-f6a230c5cd2a.png"> <!-- github-sync-id:167888051 -->
adam closed this issue 2026-10-05 00:00:18 +02:00
Author
Owner

This is the first time I see this error! I wonder why Piwigo has this unexpected behavior!

What is your version of PHP?

This is the first time I see this error! I wonder why Piwigo has this unexpected behavior! What is your version of PHP? <!-- github-comment-id:235656081 -->
Author
Owner

Hi Pierrick,

Thanks for checking:

PHP Version 5.6.21-1~dotdeb+7.1

Best,

Troy

On Wed, 27 Jul 2016 10:19:41 -0700
Pierrick Le Gall notifications@github.com wrote:

This is the first time I see this error! I wonder why Piwigo has this
unexpected behavior!

What is your version of PHP?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
https://github.com/Piwigo/Piwigo/issues/511#issuecomment-235656081

Hi Pierrick, Thanks for checking: PHP Version 5.6.21-1~dotdeb+7.1 Best, Troy On Wed, 27 Jul 2016 10:19:41 -0700 Pierrick Le Gall notifications@github.com wrote: > This is the first time I see this error! I wonder why Piwigo has this > unexpected behavior! > > What is your version of PHP? > > --- > > You are receiving this because you authored the thread. > Reply to this email directly or view it on GitHub: > https://github.com/Piwigo/Piwigo/issues/511#issuecomment-235656081 <!-- github-comment-id:235806323 -->
Author
Owner

same issue for me
Version de PHP 5.6.19

same issue for me Version de PHP 5.6.19 <!-- github-comment-id:242389661 -->
Author
Owner

Solution on 1&1 hosts

In a php.ini file, place :

date.timezone = Europe/Paris

Then in a copy.php file, place :

<?php 
// set this value to Y if you only want to overwrite old php.ini files 
// set this value to N if you want to put a php.ini file in every directory 
$overwriteOnly = "N"; 

if ($overwriteOnly == "Y") echo "Operating in Overwrite Only Mode<br><br>"; 
$path = "."; 
$source = $path . "/php.ini";
if (!file_exists($source)) die('Error - no source php.ini file'); 
function search($dir) { 
global $source; global $overwriteOnly; 
$dh = opendir($dir); 
while (($filename = readdir($dh)) !== false) { 
if ( $filename !== '.' AND $filename !== '..' AND $filename !== 'cgi-bin' AND is_dir("$dir/$filename") ) { 
$path = $dir."/".$filename; 
$target = $path . "/php.ini"; 
if (!file_exists($target) AND $overwriteOnly == "Y") { 
echo "$path <b>skipped - no php.ini file</b><br>"; 
} else { 
echo "$target <br>"; 
if (!copy($source,$target)) echo "<b>Write failed for $target </b><br>";
if (file_exists($target)) chmod($target,0600);
} 
search($path); 
} 
} 
closedir($dh); 
} 
search($path); 
echo "<br>Done."; 
?>

This script will put the bloody php.ini in all the folders of Piwigo, because stupid 1&1 can't set a correct timezone in there php.ini

Upload the 2 files in your piwigo folder, and go to http://yourwebsite/piwigo/copy.php

Enjoy

**Solution on 1&1 hosts** In a php.ini file, place : `date.timezone = Europe/Paris` Then in a copy.php file, place : ``` <?php // set this value to Y if you only want to overwrite old php.ini files // set this value to N if you want to put a php.ini file in every directory $overwriteOnly = "N"; if ($overwriteOnly == "Y") echo "Operating in Overwrite Only Mode<br><br>"; $path = "."; $source = $path . "/php.ini"; if (!file_exists($source)) die('Error - no source php.ini file'); function search($dir) { global $source; global $overwriteOnly; $dh = opendir($dir); while (($filename = readdir($dh)) !== false) { if ( $filename !== '.' AND $filename !== '..' AND $filename !== 'cgi-bin' AND is_dir("$dir/$filename") ) { $path = $dir."/".$filename; $target = $path . "/php.ini"; if (!file_exists($target) AND $overwriteOnly == "Y") { echo "$path <b>skipped - no php.ini file</b><br>"; } else { echo "$target <br>"; if (!copy($source,$target)) echo "<b>Write failed for $target </b><br>"; if (file_exists($target)) chmod($target,0600); } search($path); } } closedir($dh); } search($path); echo "<br>Done."; ?> ``` This script will put the bloody php.ini in all the folders of Piwigo, because stupid 1&1 can't set a correct timezone in there php.ini Upload the 2 files in your piwigo folder, and go to http://yourwebsite/piwigo/copy.php Enjoy <!-- github-comment-id:298770304 -->
Author
Owner
Nope use the local config http://piwigo.org/forum/viewtopic.php?pid=136114#p136114 <!-- github-comment-id:298770828 -->
Author
Owner

Does not work with 1&1, special config...

Does not work with 1&1, special config... <!-- github-comment-id:298771052 -->
Author
Owner

@GuillaumeCale ! Weird no one has reported that. What's your hosting details (plan, country etc) plz? Thank you

@GuillaumeCale ! Weird no one has reported that. What's your hosting details (plan, country etc) plz? Thank you <!-- github-comment-id:298771665 -->
Author
Owner

1and1 Basic
Php 5.6.30
Piwigo 2.9.0 (same issue with 2.8.6)
France

1and1 Basic Php 5.6.30 Piwigo 2.9.0 (same issue with 2.8.6) France <!-- github-comment-id:298772073 -->
Author
Owner

user_list_backend.php is no longer in use, issue no longer relevant.

`user_list_backend.php` is no longer in use, issue no longer relevant. <!-- github-comment-id:1443130304 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#476