Images posted are all invisible to the normal users.

Image Publishing modue only uses node_save when creating images. This causes incompatibility an with some modules (eg. Organic Groups) that want to work on the post before save happens. Therefor Image Publishing Module should call node_submit before calling node_save....

This will help in case of Organic Groups because all nodes that have no groups attached are marked as public then.

Comments

bwynants’s picture

tested and it works...

  $node->images['_original'] = file_directory_temp() . '/' . $filename;

  if ($node = node_submit($node)) {
    // let the image module generate the preview/thumbnail
    _image_build_derivatives($node, true);
	
    // save the node
    node_save($node);
  }
pangloss’s picture

Just wanted to check in to say thanks for the fix. Still on vacation with limited internet access so will not be able to update cvs till I get back in early August.

bwynants’s picture

also the comment setting is not correct

  $node->comment = variable_get("comment_$node->type", COMMENT_NODE_READ_WRITE);
zach harkey’s picture

What is the status of this fix?

underpressure’s picture

$node->comment = variable_get("comment_$node->type", COMMENT_NODE_READ_WRITE);

When will this be corrected? I just had to manually edit 80 pictures to enable this feature and now have to do bout another thousand. Please fix this, for the sake of my wrist.

bwynants’s picture

the code-snippits in this post should help you fix the problem, why wait? I adjusted the node_operations in node to be able to set te comments correct for submitted posts. 1000 edit or 1000 checkboxes :-) you choose

addition to node module, look for function node_operations

/**
 * List node administration operations that can be performed.
 */
function node_operations() {
  $operations = array(
    'approve' =>   array(t('Approve the selected posts'), 'UPDATE {node} SET status = 1, moderate = 0 WHERE nid = %d'),
    'promote' =>   array(t('Promote the selected posts'), 'UPDATE {node} SET status = 1, promote = 1, moderate = 0 WHERE nid = %d'),
    'sticky' =>    array(t('Make the selected posts sticky'), 'UPDATE {node} SET status = 1, sticky = 1 WHERE nid = %d'),
    'demote' =>    array(t('Demote the selected posts'), 'UPDATE {node} SET promote = 0 WHERE nid = %d'),
    // Bert added
    'comment r/w' => array(t('Read/Write comments'), 'UPDATE {node} SET comment = 2 WHERE nid = %d'),
    'comment r' =>   array(t('Read comments'), 'UPDATE {node} SET comment = 1 WHERE nid = %d'),
    'comment off' => array(t('No comments'), 'UPDATE {node} SET comment = 0 WHERE nid = %d'),
    'unpublish' => array(t('Unpublish the selected posts'), 'UPDATE {node} SET status = 0 WHERE nid = %d'),
    'delete' =>    array(t('Delete the selected posts'), '')
  );
  return $operations;
}

/**
 * List node administration filters that can be applied.
 */
function node_filters() {
  // Regular filters
  $filters['status'] = array('title' => t('status'),
    'options' => array('status-1'   => t('published'),     'status-0' => t('not published'),
                       'moderate-1' => t('in moderation'), 'moderate-0' => t('not in moderation'),
					   // Bert added
                       'comment-2' => t('r/w comments'), 'comment-1' => t('r comments'),  'comment-0' => t('no comments'),
                       'promote-1'  => t('promoted'),      'promote-0' => t('not promoted'),
                       'sticky-1'   => t('sticky'),        'sticky-0' => t('not sticky')));
  $filters['type'] = array('title' => t('type'), 'options' => node_get_types());
  // The taxonomy filter
  if ($taxonomy = module_invoke('taxonomy', 'form_all', 1)) {
    $filters['category'] = array('title' => t('category'), 'options' => $taxonomy);
  }

  return $filters;
}

create a filter to show all images with the worn settings and correct them via yoursite/admin/node

Hope this helps

Bert

yngens’s picture

Bert, I tried your code - unfortunately it does not allow to massively assign nodes to organic groups. Can you please advice how to make Image Publishing module to assign nodes to certain OGs or to make node editing massively assign already uploaded pictures to OGs?

bwynants’s picture

For OG groups I have no solution. I do know that there are some special hooks in 5.0 to add actions but I never used them.....

I'm sorry

bwynants’s picture

Status: Active » Closed (fixed)

The maintainer of the module is on holiday. I can not commit changes in this project. therefor I placed the latest version in an archive on the web

All changes/fixes here have been committed to that archive.

The 5.0 module can be found on http://www.goju-ryu.be/image_pub.zip