Skip to content

Commit 57022cd

Browse files
committed
Include parameters in the ID of grid / list views
1 parent 834f5fd commit 57022cd

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

wcfsetup/install/files/lib/system/gridView/AbstractGridView.class.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,16 @@ public function isAccessible(): bool
428428
*/
429429
public function getID(): string
430430
{
431-
$classNamePieces = \explode('\\', static::class);
431+
$id = \str_replace('\\', '_', static::class);
432432

433-
return \implode('-', $classNamePieces);
433+
if ($this->getParameters() !== []) {
434+
$parameters = $this->getParameters();
435+
\array_multisort($parameters);
436+
437+
$id .= '_' . \sha1(\serialize($parameters));
438+
}
439+
440+
return $id;
434441
}
435442

436443
/**

wcfsetup/install/files/lib/system/listView/AbstractListView.class.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,16 @@ public function isAccessible(): bool
357357
*/
358358
public function getID(): string
359359
{
360-
$classNamePieces = \explode('\\', static::class);
360+
$id = \str_replace('\\', '_', static::class);
361361

362-
return \implode('-', $classNamePieces);
362+
if ($this->getParameters() !== []) {
363+
$parameters = $this->getParameters();
364+
\array_multisort($parameters);
365+
366+
$id .= '_' . \sha1(\serialize($parameters));
367+
}
368+
369+
return $id;
363370
}
364371

365372
/**

0 commit comments

Comments
 (0)