Element render weight should get type cast

Created on 21 March 2019, almost 6 years ago
Updated 7 September 2023, over 1 year ago

Issue: I sometimes see a php warning when I add a block using `/admin/structure/block`. This is difficult to reproduce in the wild, but here's an example of the error (see attached stacktrace.txt).

Problem: Some field weights are stored as "", which Drupal interprets as a value, but then chokes on the math because it's not a numeric value.

Solution: When the weight is calculated, type cast it as `(float)`.

πŸ› Bug report
Status

Closed: cannot reproduce

Version

9.5

Component
RenderΒ  β†’

Last updated about 8 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States koppie

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    @koppie Thank you for reporting this problem. We rely on issue reports like this one to resolve bugs and improve Drupal core.

    Is this issue still a problem?

    The issue summary states that the problem happens 'sometimes'. But in order to be committed we need to fully understand how this happens so the test and fix are comprehensive.

    Since we need more information to move forward with this issue, I am keeping the status at Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

  • Status changed to Closed: cannot reproduce over 1 year ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    Steps to reproduce haven't been provided. Therefore, closing. If this is incorrect reopen the issue, by setting the status to 'Active', and add a comment explaining what still needs to be done.

    Thanks!

Production build 0.71.5 2024