Prior to Backdrop 1.7.0, hook_layout_presave()
was passed a parameter named $data
that was an array. After 1.7.0, this parameter is now a Layout
object.
Before:
<?php
function mymodule_layout_presave($layout_name, array &$data) {
if ($data['name'] === 'layout_name') {
// Do something.
}
}
?>
After:
<?php
function mymodule_layout_presave(Layout $layout) {
if ($layout->name === 'layout_name') {
// Do something.
}
}
?>
It's also worth noting the documentation for hook_layout_presave()
has been incorrect from the time it was introduced. It has always indicated that a $layout object was passed, but this was not the case until version 1.7.0.
Introduced in branch:
1.x
Introduced in version:
1.7.0
Impacts:
Module developers
Related Github Issues: