0

I have installed the Media Gallery module for someone's site to upload fotoalbums with; it's need to add a file size restriction because quite a bit of pictures are coming in.
I can't tell what the exact error is in English; the site's language is Dutch. When I want to edit fields in my Media Gallery content type, I get a message that says the settings are stored in the database, locked and I can't change those settings anymore.

Update: There is a similar issue at Drupal.org; it looks like it isn't possible. Or is it?

  • Whats your Question ? – niksmac Apr 19 '12 at 8:33
  • I would like to change the settings but I can't – Immers Apr 19 '12 at 8:38
  • There is a configuration page for sure. Take a look at tuts here drupalgardens.com/documentation/gallery – niksmac Apr 19 '12 at 8:40
  • This is a tutorial for those who want to install and use Media Gallery. What I need is to edit the cck fields of the content type as posed in my question: "But when I want to edit fields in my Media Gallery content type..." – Immers Apr 19 '12 at 8:46
  • also the answer drupal.org/node/1202642#comment-5073842 – niksmac Apr 19 '12 at 9:36
0

You can make the 'dirty solution' from the link posted by @NikhilMohan into a more 'clean' one pretty easily:

function MYMODULE_form_media_gallery_node_form_alter(&$form, &$form_state) {
  if (arg(1) == 'add') {
    // Get the language code from the node object. Should be reliable.
    $langcode = $form['#node']->language;

    $form['settings_wrapper']['presentation']['media_gallery_allow_download'][$langcode]['#default_value'] = 0;
  }
}

If you're not comfortable writing a custom module you can easily drop this function into your theme's template.php file instead, but change the name of the function to MYTHEME_form_media_gallery_node_form_alter. Once you clear Drupal's caches the hook will start to be called.

Don't forget that Media Gallery is still in beta so you have to expect a few bugs/missing configuration options. Using hooks to alter the fields you need to is pretty much the only option you have here, without going directly into the database.

  • Awesome. So yes it's beta and hasn't been updated since okt2011 so it looks like brave php attempts are needed – Immers Apr 23 '12 at 8:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.