After long searching and checking plenty of image inserting modules ImageAttach will be the best for me.
But I'd like to ask for some help. I think this will be an easy patch... I tried by myself but I'm not really php programmer so it's hard...

What I need is to simply have form field in place of select list - in place where choosing image node.
Now it's a selectable list and this will be hard to find anything there when image number is more than hundret. So I just have a filter view to find my wanted picture category and take the NID. And the simples way is to insert the NID into some form in image_attach.

I hope this is just a small change (for this module maintainer) and may be given as a small patch.
Hope to get some help as need this very much.

Comments

joachim’s picture

Title: Simple patch needed » improve image selection usability
Version: 6.x-1.0-beta3 » 6.x-1.x-dev
Category: support » feature

Yeah, on even small to medium sites the image attach select box gets unusable - beyond 100 or so image nodes as you say.

The thing is, image attach has a limited lifespan -- in Drupal 7 we will most probably convert to running on top of CCK noderef.
CCK noderef *also* has the same problem, but it has an API to support different widgets as a front end to the same data, and so several plug-in modules exist to provide a better selecting system.

But the upshot is that improving this isn't a high priority for me. My time is limited, and for the 1.0 release I have been concentrating on bug fixes and essential features.

I'm going to leave this open in case someone else can provide a patch.

I would suggest that rather than a nid entry, the best things would be an ajaxy selector on taxonomy. But then, which vocabulary? What if there are no vocabs on images ? etc etc.
This very quickly becomes a complicated system to implement, as you can see -- and like I say, code with a short lifespan.

konrad1811’s picture

I suggested just nid entry - simple form as this is the simplest thing.
Just to replace the list with form...
Of course it would be better to make some included filters like image_assist and choose pictures by clicking but I know it make take a lot of time. That's way I just asked for this little but really helpfull thing like changing list in a form.

Selector based on taxonomy I may do by myself using views. So just form entry needed...

However drupal 7 release won't support this I think D6 will last a long time. New D7 won't have support of many module, that's way many people will use D6. Even D6 does not have many helpfull modules that You can find in D5.

Thanks for answear... Maybe someone will notice this and make some little patch...

konrad1811’s picture

I've tried to place additional codes:
[in line 219 function image_attach_form_alter(&$form, $form_state, $form_id) of image_attach.module]

	$form['image_attach']['iids'] = array(
          '#type' => 'select',
          $value => empty($node->iids) ? NULL : $node->iids,
          '#multiple' => TRUE,
          '#size' => 6,
          // Title, options and description are set just below.
        );
//my own input field to place chosen iid number
		$form['image_attach']['chosen_iid']=array(
          '#type' => 'textfield',
          '#title' => t('Index fotki'),
          $value => '',
          '#description' => t('Wstaw znaleziony index fotki.')
        );

and additional in function image_attach_image_add_submit(&$form, &$form_state):

  $c_iid=$form_state['values']['chosen_iid'];
  if(isset($c_iid) && is_int($c_iid) && $c_iid>0){
     db_query("DELETE FROM {image_attach} WHERE nid = %d", $form['nid']['#value']);
     db_query("INSERT INTO {image_attach} (nid, iid, weight) VALUES (%d, %d, %d)", $form['nid']['#value'], $c_iid, -1);
  }

but this is not working - nothing happends, image with c_iid NID entered in the input field is not submitted... of course without this ?php? marks - just put here to mark keywords

konrad1811’s picture

Title: improve image selection usability » improve image selection usability [little patch needed]

I do not really see how to solve this... but I want to open my news-site soon... So please help me.
It's complecated to get know wher and how these all variables and arguments are passed... Just want to add additional input entry that will take NID (image node id) and insert the image into article body the same way as select list (after preview or submit button clicked).
[Would be nice if after refreshing/validation form the input field was felt in with the number recently inserted]
I've already lost 2 days searching how it work bu I'm not really good programmer, espacially not php which seems like freestyle programming...

joachim’s picture

Use devel module's dsm() function to debug.

Looking at your code snippets:
- image_attach_image_add_submit -- this is only called from the Attach form button. You should add code to what is already in the nodeapi update instead, I think.
- your DB changes as they are would get clobbered anyway in the nodeapi update
- are you only ever attaching one image? your code will kill previously attached images.

konrad1811’s picture

Ok I was looking around making some changes and undoing... And I didn't manage to do this.
But I've found probably a bug beetween workflow and image_attach (I'm not sure this wasn't mebecause I was makeing some changes... but 80% not me :-)

When adding image using image attach everything is ok (so my changes were no destructive). After all image is added and in preview article looks fine. However after workflow state change - image added with image_attach are erased...

I tried this with 2 roles I created. Editing post does not erase image. But state change does. I tried if some permissions don't just hide image but there are no permissions about visibility of image attached with image attach...
I also use lightbox2... it handles the image too... so maybe it's lightbox issue?

However if someone could check if workflow state change erase image node from article this might be helpfull to others.
I probalby will try other modules now...

joachim’s picture

What do you mean by workflow state change? Could you file this as a separate bug report please?

konrad1811’s picture

Workflow state change I mean I make w workflow with different roles, and if someone changes article state form example state "preparing" to example state "revision". I mean using workflow module. Ok I'll report this bug.

joachim’s picture

Title: improve image selection usability [little patch needed] » improve image selection usability

Changing title -- everything needs a patch ;)

AaronBauman’s picture

Image Attach Browse

Working on a stable release to reflect latest updates to Image Attach.
Should be out in the next few days.

joachim’s picture

Status: Active » Closed (won't fix)

Sounds very interesting! I've quickly installed this and had a look and it's very cool!

Do please add a link to your module on the main handbook page for Image module.
And in passing I also recommend you put a screenshot on your project page.

I am going to close this issue since this is available now, and I urge all commenters to this issue to go and try this module and give beta testing feedback :)

PS. I have just been to file a bunch of bug reports on this... sorry! But it is really cool; and that's what beta releases are for :D