After saving a node with a brightcove video field, the data IS saved. However when visiting the edit form again will not display the entered and stored value. I tracked this down to the brightcove_field_browser_value function within brightcove_field.module. I have created a patch that properly checks the array that exists within the $form_state['input'] element. The current implementation treats an empty array as having a value. The patch changes the code to walk over the array and check for an actual value within the array.
Hope this helps
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | brightcove-field-saved-value-1673884-9.patch | 1.1 KB | drupalninja99 |
| #3 | brightcove-field-saved-value-1673884-3.patch | 564 bytes | temaruk |
| #1 | brightcove_field_fix-1673884.patch | 665 bytes | mbopp |
Comments
Comment #1
mbopp commentedPatch Attached...
Comment #2
beanluc commentedWorks for me. Thank you, mbopp!
Comment #3
temaruk commentedMbopp, thank you for discovering the issue and providing a fix!
I think the fix could be much more lightweight, please take a look at the attached patch. Basically the check here has to make sure, that the default value is retained as long as it is not an edit form submit, so it is enough to check for if a submit has really happened.
Comment #4
mpgeek commentedThe patch at #3 worked for me; the patch at #1 did not. I still have ajax issues, but the forgetful field problem is fixed with this.
Comment #5
drupalninja99 commentedDid this not ever make its way into 3x dev?
Comment #6
damienmckenna@drupalninja99: No, if it had been committed the ticket would have been updated.
Comment #7
k.dani commentedThe problem has been fixed in the latest release, so the issue can be closed.
Comment #8
drupalninja99 commentedI still see this in 5x
Comment #9
drupalninja99 commentedI have reapplied a similar patch to the 5x branch
Comment #10
k.dani commentedI can only reproduce the problem after I've uploaded a new video to brightcove and saved the content. If I check the edit page after that, I could only see the brightcove id for a while (because of BC cache). In normal way, after I've browsed an element, it works fine for me. I'm going to change the title of the issue to "Saved values for newly uploaded videos on BC video field not displaying on form" to be more specific. Unfortunately, the patch won't fix this problem, so I take it back to needs work status.
Comment #11
k.dani commentedThe problem has been fixed. The object of newly created videos and playlists are cached, so it will be available during the time it is not available on Brightcove side. The fix has been added to the latest dev branch (Commit bb56cf9 on 7.x-5.x).