Closed stpaultim closed 3 weeks ago
Yup, that's a bug. The problem is that the if statement in line 537 of layout.class.inc
fails when $position
is 0.
The correct line should be
if (is_numeric($position)) {
I'm giving this the "Good First Issue" tag, because we seem to have a short one line change and just need someone to create a PR. If additional work is required, that might not be good for a first time contributor.
I'm not strictly a first contributor, but I feel like... you see, I just created a pr to my own repo...
Excellent, thank you @robertgarrigos! I merged https://github.com/backdrop/backdrop/pull/4888 into 1.x and 1.29.x. Thank you @argiepiano and @stpaultim!
@robertgarrigos and @argiepiano - Thanks very much for working on this. This will be VERY helpful for recipes!
Description of the bug
The code to add a block to a layout in a specific position, does not seem to be working properly.
Steps To Reproduce
To reproduce the behavior:
Spin up a new/demo site.
Add and enble the devel module
Use devel module to execute the following php
Check front page and see that the promoted content block has been added to the END of the top region, instead of as the first item in the top region.
It is possible that it is my syntax that is incorrect. See:
https://docs.backdropcms.org/api/backdrop/core%21modules%21layout%21includes%21layout.class.inc/function/Layout%3A%3AaddBlock/1
Expected behavior
I expected the Promoted Content block to be the first item in the top region, NOT the last item.
Additional information
It is possible that I've just got the wrong syntax.