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

Comments

mbopp’s picture

Assigned: mbopp » Unassigned
Status: Active » Needs review
StatusFileSize
new665 bytes

Patch Attached...

beanluc’s picture

Status: Needs review » Reviewed & tested by the community

Works for me. Thank you, mbopp!

temaruk’s picture

StatusFileSize
new564 bytes

Mbopp, 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.

mpgeek’s picture

The 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.

drupalninja99’s picture

Did this not ever make its way into 3x dev?

damienmckenna’s picture

@drupalninja99: No, if it had been committed the ticket would have been updated.

k.dani’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Closed (fixed)

The problem has been fixed in the latest release, so the issue can be closed.

drupalninja99’s picture

Version: 7.x-3.x-dev » 7.x-5.0
Status: Closed (fixed) » Active

I still see this in 5x

drupalninja99’s picture

Status: Active » Needs review
StatusFileSize
new1.1 KB

I have reapplied a similar patch to the 5x branch

k.dani’s picture

Title: Brightcove video field not displaying saved value on form » Saved values for newly uploaded videos on BC video field not displaying on form
Status: Needs review » Needs work

I 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.

k.dani’s picture

Status: Needs work » Closed (fixed)

The 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).