Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
After adding a new player I get the following warning message:
Warning: Illegal string offset '#value' in brightcove_player_form_validate_field() (line 414 of my_drupal_root\sites\all\modules\contrib\brightcove\brightcove.admin.inc).
The message doesn't seem to cause problems (that I've noticed) and everything seems to work fine. Even if I edit the Player I don't see the message again. It only seems to happen when adding a new player.
Comment | File | Size | Author |
---|---|---|---|
#3 | brightcove-unique-machine-name-fix-2211459-3.patch | 791 bytes | ladybug_3777 |
Comments
Comment #1
ladybug_3777 CreditAttribution: ladybug_3777 commentedComment #2
ladybug_3777 CreditAttribution: ladybug_3777 commentedIt looks like the issue in brightcove.admin.inc is in this function:
Maybe I'm wrong but aren't the parameters of that function wrong? Shouldn't that read:
The only problem is I can't figure out how to test this properly because it seems like Drupal 7 is already sanitizing the machine name, as I type, on the add player form. So I can't get this function to fire with incorrectly entered values. I'm almost wondering if this function isn't needed. I'm trying to learn more about how
'exits' =>
is supposed to work though. So maybe the entire function isn't doing quite the right thing. Is this function instead supposed to prevent me from entering a machine name that already exists? I can get an error to occur if I reuse a player name (causing the same machine name).Comment #3
ladybug_3777 CreditAttribution: ladybug_3777 commentedI *think* I've fixed this issue. I believe the function was supposed to check the machine name of the Player to make sure it is unique, however it was written in a way that makes it look like it was trying to validate the format. I think that is incorrect. I will need help from more experienced in Drupal to be sure I made the proper change here, but this patch removes the error I reported initially, and it also prevents the error that occurs if you try and enter an existing player machine name.
Patch is attached. Please validate that what I did is correct since I am still somewhat new to the Drupal world.
Comment #4
ladybug_3777 CreditAttribution: ladybug_3777 commentedComment #5
k.dani CreditAttribution: k.dani commentedThank you for the patch, it has been added to the latest dev version (Commit 5abd4c8 on 7.x-5.x).