Hi,

when having the "administer product features" permission, the commit checkbox appears only after clicking on the upload button. I believe it should be visible directly on the form to be more consistent between admin mode and normal user mode. Indeed, it is not required normally to click on the upload button to upload the file. Saving the form is sufficient.

Best regards.
K.
PS: thanks to those who ported the mp_file module from 5.x to 6.x. Great work!

Comments

Korchkidu’s picture

Title: [mp_file] Commit checkbox not showing in admin mode » [mp_file] New commit checkbox initial value

The 'new commit checkbox' initial value is FALSE by default when creating a new file product. This is inconsistent as it introduce different behavior if you are a user and if you are an admin:

User:
1) Go to create a new file product;
2) Fill in the common fields;
3) Choose a file to upload; You are free from manually uploading the file;
4) Save node.

Admin:
1) Go to create a new file product;
2) Fill in the common fields;
3) Choose a file to upload; You MUST upload the file manually and check the commit checkbox.
4) Save node.

I propose a simple modification so that by defaut, the behavior is the same either you are a user or an admin. If you want to modify the default behavior, then you MUST upload the file and check/uncheck the commit checkbox.

function mp_file_widget_process($element, $edit, &$form_state, $form) {

  $element['data']['commit'] = array(
  	'#type' => 'checkbox',
   	'#title' => t('Commit file to product feature'),
    '#default_value' => FALSE,
// BEGIN CHANGES
    '#value' => variable_get('mp_file_allow_sellers_perm', FALSE),
// END CHANGES
  	'#access' => user_access('administer product features')
 	);

  return $element;
}

Best regards.
K.

Korchkidu’s picture

Status: Active » Needs review
jbrodbeck’s picture

Korchkidu,

I have to play catch-up here. I saw the mp_file that wildkatana made and syndicateStorm modified, is this the version you are working on? Also, since it was never committed to the repository by turgrid, I can't say that it's formally supported yet.

However, if this is the case, I can definitely review the code and see if it's good to commit- all the while addressing whatever issues have been brought up concerning it.

Korchkidu’s picture

I am working on the version posted in http://drupal.org/node/331415, message #52. Is there a way to be sure to work with the last dev version?

Best regards.
K.

jorgerosa’s picture

Subscribing

asak’s picture

@Korchkidu - there is another version over there, posted in comment #89. until something of the sort is committed we have no way of knowing we're working on the same version.

@jbrodbeck - +1 for committing this, as it does seem stable enough for a starter, just for the sake of continues hassle-free development.

and +1 for the change mentioned in comment #1 - haven't done much testing but it looks fine.

syndicateStorm’s picture

Status: Needs review » Fixed

See the latest 6.x dev release. Several simultaneous changes/features were committed to mp_file, so there is some chance mp_file will need a short time to stabilize. If you do run into a bug or this feature isn't working exactly as expected, please respond.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.