I recently upgraded to 6.14 and during the upgrade process I also upgraded -alpha6 to beta3 and now all my attached images have disappeared.

My views had an invalid handler which I've corrected, but the attached images are not showing in either the views or the nodes anymore, I have even put a debug foreach in one of view templates to see what is happening and there is nothing being returned for the images, just the other fields.

CommentFileSizeAuthor
#2 db_capture.jpg125.33 KBbcobin

Comments

joachim’s picture

Status: Active » Postponed (maintainer needs more info)

Did you clear your cache?
Does you image_attach table still have data?
Can you look at the devel output for a node that should have an attached image -- does it have a $node->iid value?

bcobin’s picture

Version: 6.x-1.0-beta3 » 6.x-1.x-dev
Priority: Normal » Critical
StatusFileSize
new125.33 KB

I have the same or similar problem after upgrading to 6.14 - in my case, the teaser thumbnail image is OK, but in the body I just get an empty <div class="all-attached-images"></div>tag.

In beta3, the thumbnail image linked to the image (yikes!) - dev version links to the node, which makes it usable.

I'm attaching a screen capture of the image_attach table and below is the Dev output of a node with an attached image. Again, the teaser tag is fine, the body has an empty div.

This is a pretty major problem - the client is missing all the pictures on their nodes! Marking this as critical. Any ideas would be very, very helpful... thanks!



    *
      nid (String, 3 characters ) 151
    *
      type (String, 5 characters ) story
    *
      language (String, 0 characters )
    *
      uid (String, 1 characters ) 1
    *
      status (String, 1 characters ) 1
    *
      created (String, 10 characters ) 1252426979
    *
      changed (String, 10 characters ) 1253647911
    *
      comment (String, 1 characters ) 0
    *
      promote (String, 1 characters ) 1
    *
      moderate (String, 1 characters ) 0
    *
      sticky (String, 1 characters ) 0
    *
      tnid (String, 1 characters ) 0
    *
      translate (String, 1 characters ) 0
    *
      vid (String, 3 characters ) 152
    *
      revision_uid (String, 1 characters ) 1
    *
      title (String, 68 characters ) Birthday Buddies - Because every child should h...
          o
            Birthday Buddies - Because every child should have a happy birthday
    *
      body (String, 643 characters ) <p>There is no one to assure that children in f...
          o
            <p>There is no one to assure that children in foster care receive a gift on their birthday or have a birthday party. The Rocky Mountain Children’s Law Center Birthday Buddies do just that. 100 volunteers ensure that every foster child served by the Children’s Law Center will celebrate his or her special birthday.</p> <p>With the support of volunteers, the Children’s Law Center provides a personalized birthday gift for each of our clients on their birthday. If you would to become a Birthday Buddy and provide an extra special gift for a child please email <a href="mailto:birthdaybuddies@ymail.com">birthdaybuddies@ymail.com</a></p>
    *
      teaser (String, 584 characters ) There is no one to assure that children in fost...
          o
            There is no one to assure that children in foster care receive a gift on their birthday or have a birthday party. The Rocky Mountain Children’s Law Center Birthday Buddies do just that. 100 volunteers ensure that every foster child served by the Children’s Law Center will celebrate his or her special birthday. With the support of volunteers, the Children’s Law Center provides a personalized birthday gift for each of our clients on their birthday. If you would to become a Birthday Buddy and provide an extra special gift for a child please email birthdaybuddies@ymail.com
    *
      log (String, 0 characters )
    *
      revision_timestamp (String, 10 characters ) 1253647911
    *
      format (String, 1 characters ) 1
    *
      name (String, 5 characters ) admin
    *
      picture (String, 42 characters ) sites/default/files/pictures/picture-1.jpg
    *
      data (String, 181 characters ) a:5:{s:14:"picture_delete";s:0:"";s:14:"picture...
          o
            a:5:{s:14:"picture_delete";s:0:"";s:14:"picture_upload";s:0:"";s:7:"contact";i:0;s:13:"form_build_id";s:37:"form-644b9e1d3e1c7a33d7d32918d7147a43";s:11:"newsletters";a:1:{i:6;i:0;}}
    *
      path (String, 15 characters ) birthdaybuddies
    *
      field_weight (Array, 1 element)
          o
            0 (Array, 1 element)
                +
                  value (NULL)
    *
      last_comment_timestamp (String, 10 characters ) 1252426979
    *
      last_comment_name (NULL)
    *
      comment_count (String, 1 characters ) 0
    *
      taxonomy (Array, 0 elements)
    *
      files (Array, 0 elements)
    *
      excerpt (Boolean) FALSE
    *
      iids (Array, 1 element)
          o
            0 (String, 3 characters ) 134
    *
      locations (Array, 0 elements)
    *
      location (Array, 0 elements)
    *
      build_mode (Integer) 0
    *
      readmore (Boolean) FALSE
    *
      content (Array, 5 elements)
          o
            body (Array, 2 elements)
                +
                  #value (String, 643 characters ) <p>There is no one to assure that children in f...
                      #
                        <p>There is no one to assure that children in foster care receive a gift on their birthday or have a birthday party. The Rocky Mountain Children’s Law Center Birthday Buddies do just that. 100 volunteers ensure that every foster child served by the Children’s Law Center will celebrate his or her special birthday.</p> <p>With the support of volunteers, the Children’s Law Center provides a personalized birthday gift for each of our clients on their birthday. If you would to become a Birthday Buddy and provide an extra special gift for a child please email <a href="mailto:birthdaybuddies@ymail.com">birthdaybuddies@ymail.com</a></p>
                +
                  #weight (Integer) 0
          o
            #pre_render (Array, 1 element)
                +
                  0 (String, 27 characters ) content_alter_extra_weights | (Callback) content_alter_extra_weights();
          o
            #content_extra_fields (Array, 10 elements)
                +
                  title (Array, 3 elements)
                      #
                        label (String, 5 characters ) Title
                      #
                        description (String, 17 characters ) Node module form.
                      #
                        weight (String, 2 characters ) -5
                +
                  body_field (Array, 4 elements)
                      #
                        label (String, 4 characters ) Body
                      #
                        description (String, 17 characters ) Node module form.
                      #
                        weight (String, 1 characters ) 0
                      #
                        view (String, 4 characters ) body
                +
                  revision_information (Array, 3 elements)
                      #
                        label (String, 20 characters ) Revision information
                      #
                        description (String, 17 characters ) Node module form.
                      #
                        weight (Integer) 20
                +
                  comment_settings (Array, 3 elements)
                      #
                        label (String, 16 characters ) Comment settings
                      #
                        description (String, 20 characters ) Comment module form.
                      #
                        weight (Integer) 30
                +
                  menu (Array, 3 elements)
                      #
                        label (String, 13 characters ) Menu settings
                      #
                        description (String, 17 characters ) Menu module form.
                      #
                        weight (String, 2 characters ) -2
                +
                  taxonomy (Array, 3 elements)
                      #
                        label (String, 8 characters ) Taxonomy
                      #
                        description (String, 21 characters ) Taxonomy module form.
                      #
                        weight (String, 2 characters ) -3
                +
                  path (Array, 3 elements)
                      #
                        label (String, 13 characters ) Path settings
                      #
                        description (String, 17 characters ) Path module form.
                      #
                        weight (Integer) 30
                +
                  attachments (Array, 4 elements)
                      #
                        label (String, 16 characters ) File attachments
                      #
                        description (String, 19 characters ) Upload module form.
                      #
                        weight (Integer) 30
                      #
                        view (String, 5 characters ) files
                +
                  teaser (Array, 3 elements)
                      #
                        label (String, 7 characters ) Excerpt
                      #
                        description (String, 14 characters ) Manual excerpt
                      #
                        weight (String, 1 characters ) 0
                +
                  image_attach (Array, 3 elements)
                      #
                        label (String, 15 characters ) Attached images
                      #
                        description (String, 25 characters ) Image Attach module form.
                      #
                        weight (Integer) 0
          o
            image_attach (Array, 2 elements)
                +
                  #weight (Integer) 0
                +
                  #value (String, 39 characters ) <div class="all-attached-images"></div>
          o
            locations (Array, 3 elements)
                +
                  #type (String, 6 characters ) markup
                +
                  #value (String, 0 characters )
                +
                  #weight (String, 1 characters ) 0

joachim’s picture

Status: Postponed (maintainer needs more info) » Active

Ok so your node is 151.
The DB says it should have 134 attached.
$node->iids has 134 in it, so the data has made it in.
However, the image_attach has an empty DIV.
So it looks like the new theming function I committed is broken :( -- that should take the iids and create the image_attach HTML.

I am currently too busy to look at this in detail, so any debugging work you can do, or even a patch, would be appreciated.
And thanks for supplying the data -- made it very quick for me to figure this one out :)

bcobin’s picture

Thanks for getting back. Unfortunately, I'm not a coder, so debugging is beyond my skill set. And to make things more puzzling, Image Attach seems to work fine on my sandbox, but not on the production site, which makes me think it might be permissions-related, even thought I've set all the existing images and the files/images path to 777.

Glad I was (hopefully) able to narrow down the issue; perhaps this will give someone else some ideas. In the meantime, I am standing by... thanks!

joachim’s picture

It's not file permissions:

                  #value (String, 39 characters ) <div class="all-attached-images"></div>

The gap is in turning the iids into HTML that points to the files, but nothing happens with physical files up to this point, it's all only data.

However -- what do you see at node 134?

bcobin’s picture

I see the image file at what I assume is the original size.

joachim’s picture

Try clearing your theme cache -- the new theming function needs to get picked up and I think I changed the names.

bcobin’s picture

No change...

joachim’s picture

I think the access check might be new:

              if (node_access('view', $image)) {
                $image_nodes[] = $image;
              }

Are your images publically visible or are they, say, unpublished?

Hmm, though in that case, I should see them as admin.

We need to test what theme_image_attach_block_attached is getting -- does it get an array of $image_nodes?

bcobin’s picture

Yeah - the full node image appears in Garland, so it's theme-related after all. Everything was fine in 6.13 - can I roll back to an earlier version of Image without deinstalling and having the client lose all their attached images?

I haven't a clue as to what's happening here and now I have a site that's not fully functional - major drag.

Any ideas here would be greatly appreciated... thanks!

joachim’s picture

Do you mean the attaching node or the image node?
I reckon the image node is fine in any theme.

And you probably can't roll back if you didn't take a backup.

I'm afraid I'm really busy so can't spend any more time on this; plus there's a patch in the queue to replace all this theme code, so this is old code we're debugging. Furthermore, it really looks like it's your site that's doing something wacky. I'd suggest you get a Drupal programmer to spend some time on it.

bcobin’s picture

It's the attaching node that has the problem - I'd also assume the image is OK.

Thanks for looking into this; I have to wait for off hours to take the site offline and investigate this further - I will do so and report back.

As to "wacky," things were perfectly fine (including validation) until the latest upgrades; admittedly, ATCK (which is what I'm using) does unset a lot of Drupal stuff, so perhaps therein is where the problem lies... I will investigate... thanks!

danigrrl’s picture

Version: 6.x-1.x-dev » 6.x-1.0-beta3

I'm having the same issue - when I upgraded, the notification said that they couldn't edit something with _fid (don't remember the name), and then all my images disappeared. Checked the permissions, tried upgrading again, and nothing has brought them back.

danigrrl’s picture

I just tried Garland and two other default themes and the images are still not appearing; I'm using 960 as my base theme. Nothing was wrong until I upgraded to the new version of this module. I'm going to try reverting back to beta2 to see if my images come back - the client's site is basically broken now because of this.

danigrrl’s picture

I'll also mention that I had my old copy of the module still on my harddrive, and after re-uploading the old version and running update.php, the images now show up again. So, apparently, there's an issue with the upgrade.

bcobin’s picture

Found it! (in my case, anyway.) For me, it was a conflict with the beta1 of Feed API.

I rolled back to beta2 of the Image module and disabled Feed API (and accompanying modules); the images appeared. I then upgraded to beta2 of Feed API (which was released today) and my views with the attached images had a broken handler with the following message:

Error: handler for image_attach > iid doesn't exist!

I then deleted the broken field and replaced it - attached images seem OK now.

Very, very nasty - I lost a few days on this one - hope it saves somebody some time as you all have saved me many times over!

joachim’s picture

@bcobin: Maybe if you read the release notes? http://drupal.org/node/575958
And anyway, your problem is to do with views, so not the same as the issue here. Please don't cloud things.

@danigrrl: This sounds familiar. Could you post exact error message you get?

joachim’s picture

@danigrrl: is it your image nodes or just your attaching nodes that have the problem? If the former, was it due to this perhaps: #583076: Error on Database Updates for 6100 when upgrading to Beta3: 'duplicate entry' for primary key

bcobin’s picture

I believe I've tracked down the problem, at least in my case. I will open this post as a separate thread insofar as there seem to be several potential issues here and the problem that I found is very specific:

Bug: Incorrect path for attached images with Image 6.x-1.0-beta3 / D6.14 when Drupal running in subdirectory

Summary: When running in a subdirectory, subdirectory path for the site is incorrectly prepended to the proper attached image path. Thus, images fail to display.

Example:

Dev site base URL is "http://xxx.xx.xx.xx:8888/" - working directory in this case would be "http://xxx.xx.xx.xx:8888/[sitename]".

Correct path for attached thumbnail image should be:

"http://xx.xxx.xx.xx:8888/[sitename]/sites/default/files/images/[image].t..."

Instead, generated path is:

"/[sitename]/http://xx.xxx.xx.xx:8888/[sitename]/sites/default/files/images/[image].t..."

Obviously, this is really wrong. Evidently, this only happens when the site is running in a subdirectory; on a production site that's installed relative to the base URL, the problem doesn't appear to arise, which has made tracking this down (obvious as it is) even more of a head-scratcher.

Changes to the .htaccess file, clearing caches, theme registry, etc. have no effect.

joachim’s picture

Status: Active » Closed (fixed)

I think the original issue here was resolved.