Because manage/sort images are not actual node_forms, defaults set by the better formats module do not apply, which causes unexpected results.

Comments

kmonty’s picture

Initial fix added to hook_nodeapi:

case 'presave':
      // About to be saved (before insert/update)
      if (in_array($node->type, (array)node_gallery_get_types('image'))) {    
        if (module_exists('better_formats')) {
          $node->format = better_formats_get_default_format('node', $node->format);
        }
      }
      break;
justintime’s picture

Priority: Critical » Normal
Issue tags: +ng3

The problem with this approach is that it only fixes better_formats - any other modules will have to have their own if(module_exists) block in the presave case which will get pretty messy over time.

The cleaner (and unfortunately harder) way to do this is to use drupal_execute to actually load up the node-form which will fire all contrib modules hook_form_alter() calls.

I'm bumping the priority down on this to normal, since there are no critical feature requests, and I'm going to tag it with NG3. We've yet to port over the manage images tab from 2.x, and it's due for a refactor because of performance. I'll see if I can't get this worked in at the same time.

@kmonty, if you want this committed into 2.x, feel free to do so, as it won't break anything pre-existing.

kmonty’s picture

I agree that drupal_execute is a better solution and isn't a release blocker. Potentially when a 3.x solution is found, I can backport it to 2.x

dddave’s picture

Version: 6.x-2.x-dev » 6.x-3.x-dev
Issue tags: -ng3

per #2

justintime’s picture

Status: Active » Postponed (maintainer needs more info)

Kevin (or anyone else who knows what to look for) - can you tell us if this by chance got fixed with the refactor of the manage images tab?

zengenuity’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

At this point, I won't be adding new features to the D6 version. If features are wanted for D7, please post a new issue.