After commit of #5 commit of #attribute on https://www.drupal.org/node/2627442 , I am still getting the same warning due to is_array() throwing exception
$element['#attributes'] = is_array($element['#attributes']) ? $element['#attributes'] : array();
In this when the condition of is_array() is true then it means that $element[#attributes] is defined but when the condition is false then it means that in element #attributes is not defined so it is throwing the exception.
When condition is true then everything works fine but when it is not then it does not work fine.
So when i tried !empty instead of is_array() it worked for me.
$element['#attributes'] = !empty($element['#attributes']) ? $element['#attributes'] : array();
Comment | File | Size | Author |
---|---|---|---|
#4 | notice_undefined-2853482-4.patch | 595 bytes | shadcn |
#2 | radix-undefined_attribute_error-2853482-2.patch | 607 bytes | akshay4627 |
Comments
Comment #2
akshay4627 CreditAttribution: akshay4627 commentedComment #3
shadcn CreditAttribution: shadcn at Chapter Three commentedThanks @akshay4627. Let me test this.
Comment #4
shadcn CreditAttribution: shadcn at Chapter Three commented@akshay4627 what if we use what core already uses? Can you test this patch and see if it solves your issue? Thanks.
Comment #5
akshay4627 CreditAttribution: akshay4627 commented@arshadcn Yes the patch in #4 is working fine but my patch made for https://www.drupal.org/node/2627442#comment-10823450 commit .
Comment #6
shadcn CreditAttribution: shadcn at Chapter Three commentedYeah I think this should fix it for both issues.
Comment #7
Albert Volkman CreditAttribution: Albert Volkman commented@arshadcn what's the status of this ticket?