Skip to content

Commit

Permalink
Miscellaneous fixes for Cake 5 (CFM-338)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benn Oshrin committed Sep 11, 2025
1 parent 5493369 commit b04aba0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/src/Controller/StandardPluginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function beforeFilter(\Cake\Event\EventInterface $event) {
*/

public function beforeRender(\Cake\Event\EventInterface $event) {
/** var string $modelsName */ (ie: from ModelsTable, eg FileProvisionersTable)
/** var string $modelsName (ie: from ModelsTable, eg FileProvisionersTable) */
$modelsName = $this->getName();
/** var Cake\ORM\Table $table */
$table = $this->fetchTable($modelsName);
Expand Down
4 changes: 2 additions & 2 deletions app/src/Lib/Traits/LabeledLogTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function cliLogPercentage(int $done, int $total): void {
* @param string $msg Log message
*/

public function llog(string $level, string $msg, int|string $id=null) {
public function llog(string $level, string $msg, mixed $id=null) {
self::slog($level, $msg, $id);
}

Expand All @@ -80,7 +80,7 @@ public function llog(string $level, string $msg, int|string $id=null) {
* @since COmanage Registry v5.0.0
*/

public static function slog(string $level, string $msg, int|string $id=null) {
public static function slog(string $level, string $msg, mixed $id=null) {
$bt = debug_backtrace(0, 2);

$m = getmypid() . " " . $bt[1]['class'] . "::" . $bt[1]['function']
Expand Down
2 changes: 1 addition & 1 deletion app/src/Model/Table/MostlyStaticPagesTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ public function validationDefault(Validator $validator): Validator {
// AR-MostlyStaticPage-2 A Mostly Static Page name may consist only of lowercase alphanumeric
// characters and dashes
$validator->add('name', [
'filter' => [
'slugfilter' => [
'rule' => ['custom', '/^[a-z0-9-]+$/'],
'message' => __d('error', 'MostlyStaticPages.slug.invalid')
]
Expand Down
4 changes: 3 additions & 1 deletion app/src/Model/Table/ServersTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ public function initialize(array $config): void {
->setForeignKey('match_server_id');

// XXX Note this will bind to (eg) CoreServer but not (eg) SqlProvisioner
$this->setPluginRelations();
// As of Cake 5 this is causing errors with the Servers alias already being set,
// it's not clear that we need this anymore?
// $this->setPluginRelations();

$this->setDisplayField('description');

Expand Down

0 comments on commit b04aba0

Please sign in to comment.