Problem/Motivation
It was discovered in #3379725: Make Block config entities fully validatable that the Block weight exported property is often null.
This seems to have been unintentional/an oversight, because
BlockInterface::getWeight()has aintreturn type- its implementation
Block::getWeight()does not cast fromnulltoint
Therefore null never makes sense, and it's only thanks to PHP's automatic typecasting that this has never been a problem 😅
Steps to reproduce
N/A
Proposed resolution
- Remove the
nullable: truethat #3379725: Make Block config entities fully validatable added. - Provide an update path that converts a
weightofnullto0for all blocks.
Remaining tasks
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
None.
Comments
Comment #2
alexpottConfig schema casting on save is why this is never actually a NULL once a block is saved. I'm not sure that this should be a separate issue from #3379725: Make Block config entities fully validatable
Comment #3
phenaproximaPer #3379725-32: Make Block config entities fully validatable, this has to be handled over in that issue. Closing this out.