mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-12 01:54:26 +02:00
Fixed E_NOTICE in listing worker queue and new utilities class added (#5521)
* Fixes for E_NOTICE in workqueue: - introduced class `Friendica\Util\Arrays` which will hold static methods for handling arrays that cannot be done with PHP's functions, like implode() on multi-dimensional arrays - rewrote old-school for() loop to foreach() * Added intial unit test with some tests on empty delimiters and/or sinle and multi-dim array. * Added test for for 3-dimensional arrays, thanks to nupplaphil's feedback.
This commit is contained in:
parent
3da1b9f319
commit
bf87ad4fcf
3 changed files with 166 additions and 2 deletions
|
@ -21,6 +21,7 @@ use Friendica\Model\Item;
|
|||
use Friendica\Model\User;
|
||||
use Friendica\Module\Login;
|
||||
use Friendica\Module\Tos;
|
||||
use Friendica\Util\Arrays;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\Temporal;
|
||||
|
||||
|
@ -783,9 +784,9 @@ function admin_page_workerqueue(App $a)
|
|||
$statement = DBA::select('workerqueue', ['id', 'parameter', 'created', 'priority'], ['done' => 0], ['order'=> ['priority']]);
|
||||
$r = DBA::toArray($statement);
|
||||
|
||||
for($i = 0; $i < count($r); $i++) {
|
||||
foreach ($r as $key => $rr) {
|
||||
// fix GH-5469. ref: src/Core/Worker.php:217
|
||||
$r[$i]['parameter'] = implode(json_decode($r[$i]['parameter'], true), ': ');
|
||||
$r[$key]['parameter'] = Arrays::recursiveImplode(json_decode($rr['parameter'], true), ': ');
|
||||
}
|
||||
|
||||
$t = get_markup_template('admin/workerqueue.tpl');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue