Download & Extend

Drupal 7 port (img_assist)

Project:Image Assist
Version:6.x-2.0-alpha4
Component:Code
Category:feature request
Priority:major
Assigned:Rasa
Status:active

Issue Summary

Will there be a Drupal 7 port for Image Assist? I know that image functionality has been moved into core, but as far as I can see there is no way through D7 core modules to place images in the body field of other nodes. If there are no plans to port this module to D7, is there any recommendation how I could achieve this?

Comments

#1

Media module comes with a media browser and filter, and is being used at drupal gardens to do the job on Drupal 7.

#2

Thanks for the suggestion; I will have a look. One of the issues of switching over would of course be that all the Image Assist code (we at least did not insert HTML directly) would have to be converted. But then moving to D7 and image in core will mean changes anyway. Still, it would be good to know what, if any, future Images Assist will have.

#3

Subscribe
#2. One option might be to convert the IMG assist macros to straight HTML in the db directly.

#4

Converting in the DB directly may not be too difficult; it would also mean taken the right bits of the CSS from Image Assist and adding it to your theme. It would still be good to have similar functionality to Image Assist provided in Drupal 7...

#5

Version:6.x-1.1» 6.x-2.0-alpha4

Even if there are alternatives, it would still be good if the developers would tell us what their plans are for Drupal 7. If Image Assist is not to be continued it would be helpful to know so that we can prepare to move to another solution. If there are plans to port it to Drupal 7 it would be very interesting to hear details.

#6

True. Especially for people wishing to upgrade a site from D6 to D7.

#7

subscribe

#8

subscribe

#9

Interested in this as well. Regardless, an upgrade path to Drupal 7 is needed.

BTW, is there any inline image module in Drupal 7 core? Or which inline modules have #D7CX?

#10

loyukfai,
No, not in core, but see my post at #1 above.
Media module has made the pledge, and in fact already works.

#11

Thanks!

Now, we only need something to convert Image Assist tags to something compatible with the Media module.. . (btw, does it insert html tags or something else?)

#12

Definitely something else ;-)

[[{"type":"media","view_mode":"media_preview","fid":"36","attributes":{"alt":"","class":"media-image","title":"","typeof":"foaf:Image","wysiwyg":"1"}}]]

You have to turn on a filter in your chosen Text format.

Converts Media tags to Markup
This filter will convert [[{type:media... ]] tags into markup

#13

or there is way to convert all filter tag to html tag?
cause i used filter tag for all my image

#14

We should remember that Image Assist does more than just display the images. I'd assume it would not be too hard to find/write a script that changes the Image Assist codes in the nodes into proper HTML (after all Images Assist can also insert HTML). However, leaving the - in my opinion - easy to use way of managing and adding images to posts aside, Image Assist also provides links from the node the image is embedded in to the actual image node (via blocks). This very nice feature (for one of my sites it is highly important) would be lost.

Now, for all of these things there may be workarounds. But then I do wonder why there is no port for a module that is used by over 20.000 sites. I am very happy to help with testing etc. and I am sure others would too.

#15

I agree it's hard to replace img_assist. I've found it quite useful in its simplicity and there doesn't seem to be a good replacement yet. I've got Imagefield Assist (a fork of img_assist) working on a newer site - it works fairly closely but not exactly. It references the fid instead of the nid so it's not automatically associated with a particular node. It can, however, work with a particular node type with imagefield on it.

#16

Thanks for your comment, nubeli. Sadly it seems that Imagefield Assist is also not available for D7...

#17

subscribe

#18

It looks like the Media module requires a WYSIWYG editor. I prefer to use Textile as a lightweight markup system using standard plain text fields.

So a port of img_assist would be nice, unless there's a way to get Media to work with plain textareas?

#19

I made a PHP script to convert Image Assist Tag into HTML tags :

<?php
$server
= "localhost";
$login = "root";
$password = "XXXXXXXXXX";
$database = "drupal7";

///////////////////////////////////////////////////////////////////////////////////////////////////

$link = mysql_connect($server, $login, $password) or die("Connect error : " . mysql_error());
echo
"Connect OK\n";

$db_selected = mysql_select_db($database, $link);
if (!
$db_selected)
   die (
'Select DB error : ' . mysql_error());

$query = "SELECT * FROM field_data_body WHERE body_value like '%[img_assist%'";
$result = mysql_query($query);

if (!
$result) {
   
$message  = 'Query error : ' . mysql_error() . "\n";
   
$message .= 'Query : ' . $query;
    die(
$message);
}

$count=0;
while (
$row = mysql_fetch_assoc($result))
{
   
$tmp = $row['body_value'];
   
$count++;
    echo
"\n###############################################################################\n";
    echo
"Entity ID: ".$row['entity_id'];
   
//echo $tmp;   
    //echo "\n###############################################################################\n";
   
   
$start = strpos($tmp, "[img_assist");
   
    while (
$start = strpos($tmp, "[img_assist") !== FALSE)
    {
       
$end = strpos($tmp, "]", $start);
       
$img = substr($tmp, $start+12, $end-$start-12);
       
        echo
"Img: $img \n";
       
        list(
$nid, $title, $desc, $link_img, $align, $width, $height) = explode("|", $img);
       
       
$nid = substr($nid, strpos($nid, "=")+1);
       
$title = substr($title, strpos($title, "=")+1);
       
$desc = substr($desc, strpos($desc, "=")+1);
       
$link_img = substr($link_img, strpos($link_img, "=")+1);
       
$align = substr($align, strpos($align, "=")+1);
       
$width = substr($width, strpos($width, "=")+1);
       
$height = substr($height, strpos($height, "=")+1);
       
        echo
"NID: $nid \n";
       
       
$query_image = "SELECT * FROM image WHERE nid=".$nid;
       
$result_image = mysql_query($query_image);
       
       
$row_image = mysql_fetch_assoc($result_image);
       
$fid = $row_image['fid'];
       
        echo
"FID: $fid \n";
       
       
$query_file = "SELECT * FROM files WHERE fid=".$fid;
       
$result_file = mysql_query($query_file);
       
       
$row_file = mysql_fetch_assoc($result_file);
       
$img_path = $row_file['filepath'];
       
        if (
$img_path[0] != '/'
           
$img_path = '/' . $img_path;
       
        echo
"Src: $img_path \n";
       
       
$buffer = substr($tmp, 0, $start);
       
       
$buffer .= "<img alt=\"$desc\" src=\"$img_path\" style=\"width: ".$width."px; height: ".$height."px;\">";
       
       
$buffer .= substr($tmp, $end+1);
       
       
//echo "Buffer: $buffer \n";
       
       
$tmp = $buffer;
       
       
mysql_free_result($result_image);
       
//break; // Test
   
} // End : while ($start = strpos($tmp, "[img_assist"))   
   
   
$update_query = "UPDATE field_data_body SET body_value = '".addslashes($tmp)."' WHERE entity_id = ".$row['entity_id'];
   
$res = mysql_query($update_query);
   
    if (!
$res) {
       
$message  = 'Query error : ' . mysql_error() . "\n";
       
$message .= 'Query : ' . $update_query;
        die(
$message);
    }
   
   
//break; // Test
}// End : while ($row = mysql_fetch_assoc($result))

mysql_free_result($result);

mysql_close($link);
echo
"\nEnd ($count entities modified)\n\n";
?>

This script must be run on D7 database (after the update from D6 to D7).

#20

so the script need to be run on D7 database or D6?
meaning, it must be upgrade to D7 first, then run the script?

#21

The script must be run on D7 database, so you must upgrade to D7 first.

#22

I tried running this script after upgrading to Drupal 7, but img_assist tags still appear in the nodes. (Perhaps the .php file needs to be ignored in .htaccess or something?)

Also, I was still running with an alpha release of image, and hadn't enabled views when I ran the script, but I kinda expected the operation to happen at a database level to convert the tags to html.

Sorry, but I'm a just an average Drupal user, and not programmer; but please will you stipulate dependency modules or any other information you can?

At this point I'm considering trying to migrate from the image module to imagefield on Drupal 6.20, and then upgrading to D7. At that point I imagine to try and work out a database update script to replace img_assist inline images with HTML.

Don't really know where to start though. It's one thing being caught out with the image module, but then I'm doubly confounded with img_assist.

Any advice or pointers gratefully appreciated, as I am really confused.

#23

Have you modified these lines with your server's information ?

$server = "localhost";
$login = "root";
$password = "XXXXXXXXXX";
$database = "drupal7";

#24

subscribe

#25

subscribe

#26

subscribing

#27

Sadly, Media module falls down in many respects and is unusable in the way that it needs to be most usable: for users who don't have coding skills and rely on the WYSIWYG tools to create content and post images. Image Assist is the only module out there I've been able to find that:

(1) manages a library of images
(2) allows users to apply additional information to image (captions, photo credits)
(3) allows users to select image size presets
(4) allows users to place image (float left, float right, etc.)

And does all of this from a single interface within a WYSIWYG tool.

(To be fair, I think the image upload module can also do most of this in D6)

Media doesn't offer the image placement, captions or other additional information, or provide any more than the hard coded image styles available in the default installation.

These seem like really basic needs for content publishing. All of the users for whom I manage Drupal websites need to be able to do these tasks when publishing content, and they can't be the only ones who do. Image Assist is the single best module available for providing these functions. I really hope the effort to port the module to D7 hasn't been completely abandoned in favor of the inadequate Media module.

#28

Priority:normal» major

Like you, I so far have not found a module that can replace Image Assist. This is really surprising seeing how many people use the D5+6 versions and that there is a clear gap in functionality. It would be really good to get a statement from the maintainers about the future of Image Assist. If they have no intention and no one else steps up, we need to start talking to related D7 modules and see if we can get the functionality included. I hope there will be a D7 Image Assist though! I have taken the liberty to increase the priority to "major" as without that feature the days of Image Assist are counted.

#29

+1

#30

I changed a little the script #19 by xetrokis http://drupal.org/node/841568#comment-4093474 to make it run as I have some prefix in my database. like this:
$prefix = 'd6x_';
...
$query = "SELECT * FROM ".$prefix."field_data_body WHERE body_value like '%[img_assist%'";
...

I think it is not related to my prefix but I can't make it run. I have errors like this:

[img_assist
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\Users\ron\Sites\d7u2\img_assist_html.php on line 60
FID:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\Users\ron\Sites\d7u2\img_assist_html.php on line 68
Src: /
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in C:\Users\ron\Sites\d7u2\img_assist_html.php on line 86
Img: src="/" style="width: nonepx; height: 360px;">

It maybe something wrong with the initialization of the loop while ($start = strpos($tmp, "[img_assist") !== FALSE) as I noticed that $start doesn't get the good value. Could it be related to PHP version? I'm a total newbie to PHP.

I have to do the same thing with body_summary instead of body_value. And at the moment I get the same kind of error.

#31

subscribe

#32

subscribe

#33

subscribe

#34

I came across the same issues and PHP errors as rondev had when running xetrokis's script. I made a couple of bug fixes to make the script work. It ran successfully on a site with ~1500 nodes and 15 image assist tags that was upgraded from D5 -> D6 -> D7. The modified script is below, taking into account rondev's prefix suggestions. I commented the changes I made.

<?php
$prefix
= 'yourprefix';
$server = "localhost";
$login = "root";
$password = "XXXXXXXXXX";
$database = "drupal7";

///////////////////////////////////////////////////////////////////////////////////////////////////

$link = mysql_connect($server, $login, $password) or die("Connect error : " . mysql_error());
echo
"Connect OK\n";

$db_selected = mysql_select_db($database, $link);
if (!
$db_selected)
   die (
'Select DB error : ' . mysql_error());

$query = "SELECT * FROM " . $prefix . "field_data_body WHERE body_value like '%[img_assist%'";
$result = mysql_query($query);

if (!
$result) {
   
$message  = 'Query error : ' . mysql_error() . "\n";
   
$message .= 'Query : ' . $query;
    die(
$message);
}

$count=0;
while (
$row = mysql_fetch_assoc($result))
{
   
$tmp = $row['body_value'];
   
$count++;
    echo
"\n###############################################################################\n";
    echo
"Entity ID: ".$row['entity_id'];
   
//echo $tmp;  
    //echo "\n###############################################################################\n";
  
   
$start = strpos($tmp, "[img_assist");
  
    while ((
$start = strpos($tmp, "[img_assist")) !== FALSE) // Added parentheses here since operator precedence was incorrect.
   
{
       
$end = strpos($tmp, "]", $start);
       
$img = substr($tmp, $start+12, $end-$start-12);
      
        echo
"Img: $img \n";
      
        list(
$nid, $title, $desc, $link_img, $align, $width, $height) = explode("|", $img);
      
       
$nid = substr($nid, strpos($nid, "=")+1);
       
$title = substr($title, strpos($title, "=")+1);
       
$desc = substr($desc, strpos($desc, "=")+1);
       
$link_img = substr($link_img, strpos($link_img, "=")+1);
       
$align = substr($align, strpos($align, "=")+1);
       
$width = substr($width, strpos($width, "=")+1);
       
$height = substr($height, strpos($height, "=")+1);
      
        echo
"NID: $nid \n";
      
       
$query_image = "SELECT * FROM " . $prefix . "image WHERE nid=".$nid . " and image_size = '_original'"; // Changed query to always get the original image. Formerly, the query would return a row for each derivative of the image such as thumbnail.
       
$result_image = mysql_query($query_image);
      
       
$row_image = mysql_fetch_assoc($result_image);
       
$fid = $row_image['fid'];
      
        echo
"FID: $fid \n";
      
       
$query_file = "SELECT * FROM " . $prefix . "files WHERE fid=".$fid;
       
$result_file = mysql_query($query_file);
      
       
$row_file = mysql_fetch_assoc($result_file);
       
$img_path = $row_file['filepath'];
      
        if (
$img_path[0] != '/')
           
$img_path = '/' . $img_path;
      
        echo
"Src: $img_path \n";
      
       
$buffer = substr($tmp, 0, $start);
      
       
$buffer .= "<img alt=\"$desc\" src=\"$img_path\" width=\"$width\" height=\"$height\" class=\"inline inline-$align\" />"; // Not a critical change, but now specifies width and height in the image's attribute tags. Also preserves the alignment of the image if the user specified an alignment through image assist.
      
       
$buffer .= substr($tmp, $end+1);
      
       
//echo "Buffer: $buffer \n";
      
       
$tmp = $buffer;
      
       
mysql_free_result($result_image);
       
//break; // Test
   
} // End : while ($start = strpos($tmp, "[img_assist"))  
  
   
$update_query = "UPDATE " . $prefix . "field_data_body SET body_value = '".addslashes($tmp)."' WHERE entity_id = ".$row['entity_id'];
   
$res = mysql_query($update_query);
  
    if (!
$res) {
       
$message  = 'Query error : ' . mysql_error() . "\n";
       
$message .= 'Query : ' . $update_query;
        die(
$message);
    }
  
   
//break; // Test
}// End : while ($row = mysql_fetch_assoc($result))

mysql_free_result($result);

mysql_close($link);
echo
"\nEnd ($count entities modified)\n\n";
?>

#35

+1

#36

I concur. Media module does not yet have the ability to replace Image Assist.

As others have stated being able to insert images inline through the WYSIWYG (with captions and ability to easily pick through previously uploaded images) is one of the most basic and often needed attributes of a CMS.

I can't code yet, but encourage anyone who wants to help the Drupal community with something that almost everyone will use, this is a great thing to focus on - maybe through upgrading the Image Assist to Drupal 7 or making a feature or add-on for another module.

#37

From looking at the comments it seems there is a lot of interest in using Image Assist on D7, or at least having a module that provides similar functionality - and that there is no alternative yet. It would be really helpful to get a statement from the maintainers about their plans for Image Assist, although it does not look like they have any interest in making this happen.

Assuming the maintainers don't plan any D7 work, I think it would be up to us to get Image Assist ported to D7. Unfortunately, my skills are not up to the task, but I would be happy to help with testing, logistical support etc. Is there anyone around here who would be prepared to take the lead on the development, or could we perhaps all put a few bucks in as an encouragement to a developer?

Or has anyone found a suitable replacement for Image Assist for D7? See aaronpinero's posting (#27) on Image Assist features.

#38

For temporary use on a D7 site, I'm using the following mix of modules:

- For uploading images, I have added IMCE (http://drupal.org/project/imce) and the IMCE WYSIWYG API Bridge (http://drupal.org/project/imce_wysiwyg) so that IMCE will work with my editor of choice, TinyMCE. IMCE has been around a while and works well enough. The only issue I have with this arrangement is that I cannot provide 'presets' using image styles (formerly image cache).

- For placing an image, I use the image widget in TinyMCE. You can float an image left or right. The advanced options allow the addition of classes or inline styles.

- For captions, I am using the Image Caption (http://drupal.org/project/image_caption) module. I like the input filter version of this module since it's not dependent on JavaScript/jQuery.

- For placing video from third party websites (YouTube, Vimeo) I am relying on the Media module. As much as I dislike the current state of the Media module, I know it's probably the future of media handling on the website. These same folks created the very useful embedded media modules so I think they'll get the issues worked out eventually. It's just they seem currently focused on things that have nothing to do with the UI. There also seem to be a lot of cooks in their kitchen.

I'm very interested in learning about other ways folks are using contrib modules to fill the image assist gap in D7.

#39

It is an awful lot of modules just to replace a single one (okay, the video is there too - btw. I use Video Filter for that purpose as it seems relatively light weight). But then if that is what it takes to make things work... I am still stuck with D6, because of being unwilling to give up on Image Assist just yet.

#40

subscribing

#41

subscribing

#42

Subscribing. Badly needed.

#43

sub

#44

Assigned to:Anonymous» Rasa

Subscribing.

#45

subscribing. maddening. I have begun 2 Drupal 7 sites and they are such a drag to work with. I have since started my new projects in Drupal 6 for reasons such as this.

#46

+1

#47

Drupal is now on 7.8, and I still cannot use it because I need my content editors to be able to insert pictures into their copy. I have argued for like 5 years that this sort of stuff should be bread-and-butter to a CMS, eg built right into core. Oh well, at least there is v6.. :|

#48

+1

#49

I found myself in this exact position recently but I had all of my old image data in a drupal 6 database and all of the nodes in a drupal 7 database. So I modified the script post above to use 2 databases. Reposting in case someone finds themselves in the same position.

Just a couple general suggestion, backup your database before you run this script (or any of the above). Also there are some debug statements peppered through the code from previous authors. I suggest doing a dry run by tossing in an exit() after the debug output and before the update query is run to make sure the img tags and update queries look logical.

<?php

$prefix6
= 'drupal_6_prefix_';
$server6 = 'drupal_6_server';
$login6 = 'drupal_6_user';
$password6 = 'drupal_6_password';
$database6 = 'drupal_6_database';

$prefix7 = 'drupal_7_prefix_';
$server7 = 'drupal_7_server';
$login7 = 'drupal_7_user';
$password7 = 'drupal_7_password';
$database7 = 'drupal_7_database';


///////////////////////////////////////////////////////////////////////////////////////////////////

$d6 = mysql_connect($server6, $login6, $password6, TRUE) or die("Connect error : " . mysql_error());
$d7 = mysql_connect($server7, $login7, $password7, TRUE) or die("Connect error : " . mysql_error());

echo
"Connect OK\n";

$db6_selected = mysql_select_db($database6, $d6);
if (!
$db6_selected)
   die (
'Select DB error : ' . mysql_error($d6));
  
$db7_selected = mysql_select_db($database7, $d7);
if (!
$db7_selected)
   die (
'Select DB error : ' . mysql_error($d7));

$query = "SELECT * FROM " . $prefix7 . "field_data_body WHERE body_value like '%[img_assist%'";
$result = mysql_query($query,$d7);

if (!
$result) {
   
$message  = 'Query error : ' . mysql_error($d7) . "\n";
   
$message .= 'Query : ' . $query;
    die(
$message);
}

$count=0;
while (
$row = mysql_fetch_assoc($result))
{
   
$tmp = $row['body_value'];
   
$count++;
    echo
"\n###############################################################################\n";
    echo
"Entity ID: ".$row['entity_id'];
   
//echo $tmp;  
    //echo "\n###############################################################################\n";
  
   
$start = strpos($tmp, "[img_assist");
  
    while ((
$start = strpos($tmp, "[img_assist")) !== FALSE) // Added parentheses here since operator precedence was incorrect.
   
{
       
$end = strpos($tmp, "]", $start);
       
$img = substr($tmp, $start+12, $end-$start-12);
      
        echo
"Img: $img \n";
      
        list(
$nid, $title, $desc, $link_img, $align, $width, $height) = explode("|", $img);
      
       
$nid = substr($nid, strpos($nid, "=")+1);
       
$title = substr($title, strpos($title, "=")+1);
       
$desc = substr($desc, strpos($desc, "=")+1);
       
$link_img = substr($link_img, strpos($link_img, "=")+1);
       
$align = substr($align, strpos($align, "=")+1);
       
$width = substr($width, strpos($width, "=")+1);
       
$height = substr($height, strpos($height, "=")+1);
      
        echo
"NID: $nid \n";
      
       
$query_image = "SELECT * FROM " . $prefix6 . "image WHERE nid=".$nid." and image_size='_original'";
       
$result_image = mysql_query($query_image,$d6);
           
            if (!
$result_image) {
                   
$message  = 'Query error : ' . mysql_error($d6) . "\n";
                   
$message .= 'Query : ' . $query_image;
                    die(
$message);
                }
              
       
$row_image = mysql_fetch_assoc($result_image);
       
$fid = $row_image['fid'];
      
        echo
"FID: $fid \n";
      
       
$query_file = "SELECT * FROM " . $prefix6 . "files WHERE fid=".$fid;
       
$result_file = mysql_query($query_file,$d6);
      
       
$row_file = mysql_fetch_assoc($result_file);
       
$img_path = $row_file['filepath'];
      
        if (
$img_path[0] != '/')
           
$img_path = '/' . $img_path;
      
        echo
"Src: $img_path \n";
      
       
$buffer = substr($tmp, 0, $start);
      
       
$buffer .= "<img alt=\"$desc\" src=\"$img_path\" width=\"$width\" height=\"$height\" class=\"inline inline-$align\" />"; // Not a critical change, but now specifies width and height in the image's attribute tags. Also preserves the alignment of the image if the user specified an alignment through image assist.
      
       
$buffer .= substr($tmp, $end+1);
      
        echo
"Buffer: $buffer \n";
      
       
$tmp = $buffer;
      
       
mysql_free_result($result_image);
       
//break; // Test
   
} // End : while ($start = strpos($tmp, "[img_assist"))  

   
$update_query = "UPDATE " . $prefix7 . "field_data_body SET body_value = '".addslashes($tmp)."' WHERE entity_id = ".$row['entity_id'];
   
$res = mysql_query($update_query,$d7);
  
    if (!
$res) {
       
$message  = 'Query error : ' . mysql_error() . "\n";
       
$message .= 'Query : ' . $update_query;
        die(
$message);
    }
  
   
//break; // Test
}// End : while ($row = mysql_fetch_assoc($result))

mysql_free_result($result);

mysql_close($d6);
mysql_close($d7);

echo
"\nEnd ($count entities modified)\n\n";
?>

#50

subscribing

#51

I've done a bit of work on a drupal 7 port. Its not perfect but its nearly there.
You need to convert image nodes using the drupal 7 development version of the old image module and the Field Convert module.

As image sizes from old module have gone and been replaced with image styles in drupal core that is what image assist now uses. But only if the style has size only transformations - anything else and that style isn't available. Image assist now also includes 3 styles based on the old 3 sizes from the image module. You can't alter these through the front end but you can always add more styles with the sizings you need.

The attachment includes the altered image assist and the modules needed to convert the old image nodes - the development image_legacy module and Field Convert module. Drupal 7 image module is only available via the git repository at the moment. Field Convert is available to download but I've included it here as that's the version thats worked for me.

I don't have much time to offer any support for this. Use at your own risk! Please do a test migration and make sure everything works how you need it to before using this on a production site.

One thing to node when converting the image nodes is to make sure that you don't have any duplicates in your file table. If there's more than one row with the same file name you'll get errors.

AttachmentSize
img_assist_v7.zip 107.85 KB

#52

Thank you for the D7 port - I'm finding as I attempt my first D7 production site that this is very sorely needed!

But I haven't had luck getting it to work - perhaps someone could provide some guidance.

A few questions/details:

I'm using only the img_assist module insofar as this is a new site and I don't need to upgrade. Are the other modules necessary for this to work?

The included view doesn't find an acceptable content type and it doesn't seem to work with "Photo" (I'm using the OpenPublic distro and that seems to be the only suitable content type.) I don't know if this is the cause of it, but I haven't been able to get a link to show up below the edit form, no matter what I do.

In looking at the D6 version of ImageField Attach, the browser view looks fairly complex - would it be possible to get a content type/view export combination that could be expected to work out of the box in D7?

In D6, I was also able to choose whether the image could open in a Lightbox - my preferred method was to insert an image (with ImageCache preset) that when clicked on would open the original in a lightbox for greater detail. This was really elegant and I'm hoping to be able to do the same in D7. Would this be possible?

Anyway, it's good to see there's some motion here - thank you! Pretty painful transition so far, but I remain ever hopeful... assistance greatly appreciated!

Update: It looks like TinyMCE recognizes Image Assist as is (there's a little camera icon) - I get the following error, though when I try to invoke it (I'm in a sandbox):

Notice: Undefined property: stdClass::$node_image in img_assist_display() (line 1337 of /Users/[user]/sandbox/openpublic/sites/all/modules/img_assist/img_assist.module).

Perhaps this will help - thanks!

Further testing:

Using this with TnyMCE, Image Assist invokes via a camera logo in the TinyMCE toolbr (good) and offers to browse through My Images (0), of which there are none. When I try to upload a new images, I get the following error:

Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'image_node_form' was given in drupal_retrieve_form() (line 785 of /[site]/includes/form.inc).

Looking at the view, it finds no suitable content type. So I changed it to "photo" (which exists). Cleared caches and got the same result.

I think I could be missing something small - any ideas? The lack of Image Assist (particularly when it worked so nicely in D6) really is a showstopper for D7.

Thanks for any suggestions!

#53

Title:Drupal 7 port» Drupal 7 port (img_assist)

for trackers

#54

Having trouble here. I believe I have followed the instructions properly, yet I am getting errors in the field_convert step. Not understanding d7 super well yet, my guess is that field_convert should be adding many, many lines to files_managed for each of the nodes, but this is not happening. This is my error:

An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /batch?id=5163&op=do StatusText: error ResponseText: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'public://images/Sarah-McLachlan-pic.jpg' for key 2: INSERT INTO {file_managed} (uid, filename, uri, filemime, filesize, status, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => Sarah-McLachlan-pic.jpg [:db_insert_placeholder_2] => public://images/Sarah-McLachlan-pic.jpg [:db_insert_placeholder_3] => image/jpeg [:db_insert_placeholder_4] => 377528 [:db_insert_placeholder_5] => 1 [:db_insert_placeholder_6] => 1273717667 ) in image_legacy_field_convert_object_pre_load() (line 229 of /var/www/html/samaritanmag.com/site/sites/all/modules/image/image_legacy.field_convert.inc).

Happy to pay a bounty of 200 for anyone who will screenshare over my shoulder and talk me through getting this fixed and getting the img_assist d7 working on my d7 site. Pls email me asap!

#55

"One thing to node when converting the image nodes is to make sure that you don't have any duplicates in your file table. If there's more than one row with the same file name you'll get errors."

You sure you haven't got more than one row in your file table that has the same file name?

#56

Some things that don't work at moment.
When resizing the images using a custom size the javascript is incorrectly setting the width same as height / height same as width so you'll end up with a square image.

When uploading images there's an upload button next to the browse button. This doesn't work. If you submit the whole page using the save button at the bottom though the image should be uploaded and created.

#57

Thank you colling2 for your initial efforts. I'm looking forward to hearing how this shapes up. I don't have any other comment. Just gratitude.

#58

subscribing

#59

IMCE + IMCE WYSIWYG API Bridge with TinyMCE is working great as an alternative for me. The installation effort was minimal.

P.S. We really need a way on drupal.org of promoting best or summary solutions to the top of these posted questions. The only solution for someone who doesn't want to get involved in PHP coding is at number #38!

#60

Is IMCE + IMCE WYSIWYG API Bridge really a full replacement? First of all it seems to require a WYSIWYG editor (please correct me if that is wrong) whereas Image Assist does not - and I don't want to use an editor. Also, from the TinyMCE demo I have seen there was no way to centre an image (only left, right, bottom, middle, etc.)? What your solution also does not seem to do is to automatically insert links from the image node to every other node the image is embedded in - and while I may come to terms with issues one and two and having to install several modules where so far one does the trick I cannot do without those links.

So unless I am missing something (which I hope I do) there still is no real replacement for Image Assist?

#61

+1 for #60. I was actually using ImageField Assist in D6 and you could easily insert an image to taste that would open up when clicked in a lightbox (with the full-size version) and if you wanted to get into Custom Formatters, you could have a caption on the image too.

Very slick - and all without using a WYSIWYG editor, which can really be more trouble than it's worth.

I really miss this functionality in D7.

#62

This should fix the issue with the aspect ratio. This is just the module to replace the one from my earlier zip.

AttachmentSize
img_assist.zip 19.93 KB

#63

I think line:

<?php
$query_image
= "SELECT * FROM " . $prefix . "image WHERE nid=".$nid . " and image_size = '_original'";
?>

in #34 should be replaced with:

<?php
$query_image
= "SELECT * FROM " . $prefix . "file_usage WHERE id=".$nid . " and module = 'image'";
?>

It didn't work for me but with this change it now does!

#64

IMCE with the WYSIWYG Bridge is a solution, but not a complete solution. It doesn't address the addition of captions. It also stores images in a way that is outside of the Drupal entity system. It also doesn't work with Image Styles. But yeah, you can get by with it.

#65

Wow, something like nine months after this question was first posted and as far as I can tell the Image Assist maintainers have no reply regarding D7 support.

This is a huge problem for people who want a CMS (like they had with D6!) that will allow easy inserting of inline images, etc. In my case, we're trying to migrate a VERY large site from D6 that had all images inserted with Image Assist. Again, this is a massive problem for me and my client(s)...really shakes my faith in Drupal (not trying to start something here...just extremely frustrated with no simple solution in sight).

#66

I agree. Obviously, you cannot hold it against Drupal as such when maintainers of a specific module appear to give up on it, and we should also remember that many people here share their work for free - but I think it would be nice if the maintainers would at least tell us what their plans are. As things are we can only conclude that they have given up.

So we have no other choice of either saying goodbye to this module; wait wait wait; or find someone willing to migrate it. I'd be more than happy to help with testing and perhaps also contribute to a bounty for migrating the module, but we need more support.

#67

@TfR75 - have you seen the port from #51 + #62?

This is working fine for one of my previously d5 sites.

The only problem I'm having now is that when uploading images there's an upload button next to the browse button. This doesn't work. If you submit the whole page using the save button at the bottom though the image should be uploaded and created.

Getting the upload button to work shouldn't take much, I just don't have much time right now.

#68

In the next few months I will have to migrate a medium sized D6 site to D7 and will need to choose a solution. I already decided to use one of the alternative ways of inserting images in D7.

Apparently the reuse of images has less priority for my client than easy of use. img_assist is great for reusing images, but it is annoying that another window opens and you have to submit another node, with all the group membership decisions (when you use groups) and tags etc. This really slows down the work flow. The alternative methods don't allow easy reuse of images, but at least people can upload and insert faster, without pop-ups.

Depending on the complexity of the migration, I might end up with a system where old inserted images are still served and displayed through a patched img_assist module, while all new images are inserted with the alternatives available for D7. Whatever I end up doing, I promise here to keep record and document all the steps I took in the migration process and share them with you.

#69

@colling I saw the first posting but from the comments following that I concluded that it still needed some work - and then missed your follow-on comment with the updated version. I wonder if/how we can get the maintainers to include your code as a dev version. This would be the ideal way to give it the proper testing and ensure that we can all join forces to make this into a proper D7 module, supported through this site.

I will email them...

#70

I´m particularly interested in how to use other module to work with old img_assist images, because times goes by and I need to upgrade my site to D7.
I´m looking forward for your follow up @ñull!
Thanks!

#71

Update: one of the maintainers (Hannes got back to me. Sadly, he is no longer involved with the module. No response so far from the second maintainer, Daniel. I wonder if someone new was interested in becoming a maintainer?

#72

subscribe

nobody click here