Closed (fixed)
Project:
OpenPackage Video
Version:
5.x-2.2
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
11 Oct 2007 at 21:53 UTC
Updated:
9 Feb 2008 at 00:42 UTC
I'm 'cheating' a little and saving a node programmatically, so I'm not positive that this issue would affect a 'stock' user of this great module. However, in my case, if an owner tries to edit their video node they are unable to pass validation due to a missing filepath. untested fix follows:
change
if(!$node->nid ||
user_access('administer video content') ||
variable_get('op_video_node_allow_replace', OP_VIDEO_NODE_DEFAULT_ALLOW_REPLACE))
{
switch(variable_get('op_video_node_widget', OP_VIDEO_NODE_DEFAULT_WIDGET)) {
case 'upload':
$form['_op_video_upload'] = array(
'#type' => 'file',
'#title' => t('Video upload'),
'#description' => 'Max size: ' . _op_video_upload_max_size(),
'#weight' => -4
);
$form['#attributes']['enctype'] = 'multipart/form-data';
break;
case 'filepath':
$form['filepath'] = array(
'#type' => 'textfield',
'#title' => t('Video filepath'),
'#autocomplete_path' => 'op_video/autocomplete',
'#default_value' => $node->video->source_file->filepath,
'#required' => TRUE,
'#weight' => -4
);
break;
}
}
to
if(!$node->nid ||
user_access('administer video content') ||
variable_get('op_video_node_allow_replace', OP_VIDEO_NODE_DEFAULT_ALLOW_REPLACE))
{
switch(variable_get('op_video_node_widget', OP_VIDEO_NODE_DEFAULT_WIDGET)) {
case 'upload':
$form['_op_video_upload'] = array(
'#type' => 'file',
'#title' => t('Video upload'),
'#description' => 'Max size: ' . _op_video_upload_max_size(),
'#weight' => -4
);
$form['#attributes']['enctype'] = 'multipart/form-data';
break;
case 'filepath':
$form['filepath'] = array(
'#type' => 'textfield',
'#title' => t('Video filepath'),
'#autocomplete_path' => 'op_video/autocomplete',
'#default_value' => $node->video->source_file->filepath,
'#required' => TRUE,
'#weight' => -4
);
break;
}
}
else { //we need this to pass validation.
$form['filepath']=array('#type'=>'hidden','#value'=>$node->video->source_file->filepath);
}
haven't fully tested the implications of this but it seems to work alright. sorry for being a little vague in this description (in the middle of a massive bugfix run), but hopefully the code change makes my issue obvious enough.
Comments
Comment #1
ragaskar commentedyeah, that's really poorly explained. let me spend 30 seconds trying to make this clear:
in the case where :
* op_video node uses the filepath option
AND
* user does not have 'administer video nodes' permission
AND
* 'op_video_node_allow_replace' is FALSE
there is no $form['filepath'] set, which causes the form validation to fail, preventing users from updating description, title, or tags.
Comment #2
jbrown commentedComment #3
jbrown commentedThere won't be any further releases of 5.x-2.x and 5.x-3.x only exposes a field type (not a node type).
Comment #4
jbrown commentedThis is now fixed in 5.x-2.x-dev. 5.x-2.3 will be released very soon.
Comment #5
ragaskar commentedcool, thank you!
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.