I am showing two stories on my frontpage that contain images displayed with inline. I get the following warning:

warning: Invalid argument supplied for foreach() in /path/to/inline/inline_upload.module on line 76.

And the image on one of the posts doesn't show up. When I go back to the edit tab and without doing anything, resubmit the story that stories' image shows but then the other one disappears with the same warning.

CommentFileSizeAuthor
#2 inline-DRUPAL-5--2.nid_.patch1.09 KBsun

Comments

lacitpo’s picture

getting the same thing. seems to only appear on the first story showing an inline image on the main page. images are shown fine without error when viewing individual articles and inline images in subsiquent articles on the main page seem to show fine. seems the error only appears in the first post with an inline image and upon refreshing the error goes away but the image is not shown. On at least one occasion, after refreshing, a dead link to the name of the image was shown in place of where the image should be.

* warning: array_keys() [function.array-keys]: The first argument should be an array in /home/.axle/emerin/boxing.callmetom.net/modules/inline/inline_upload.module on line 63.
* warning: Invalid argument supplied for foreach() in /home/.axle/emerin/boxing.callmetom.net/modules/inline/inline_upload.module on line 76.

sun’s picture

Status: Active » Needs review
StatusFileSize
new1.09 KB

This would mean that the affected inline tag either contains nid=0 or does not contain the nid parameter at all. Could you please verify? If so, are the other inline tags different regarding the nid parameter? Is it possible that the affected inline tag was generated with Inline 1.x?

Please note that attached patch fixes the error, but not the cause.

sun’s picture

...and THANKS for testing 2.x! Your feedback is very valuable and appreciated!

lacitpo’s picture

I am using Inline 5.x-2.x-dev

The inline tag I'm using is

[inline_upload|file=2|title=teaser]

I am unsure of the syntax to use the id parameter in the inline tags. could you expound on that a bit?

sun’s picture

Status: Needs review » Fixed

This patch slipped in as part of #273489: Code clean-up.

The syntax for Inline Upload tags is described on the page that is linked in the filter tips below a textarea. Nevertheless, I've updated the documentation now and here's an example:

-- EXAMPLES --

* Suppose you uploaded three files (in this order):
  - imag1.png (referred as file #1)
  - file2.pdf (referred as file #2)
  - imag3.png (referred as file #3)

* [inline_upload|file=2] or
  [inline_upload|file=file2.pdf]
  will be replaced with <a href="file2.pdf">file2.pdf</a>

* [inline_upload|file=1|title=test] or
  [inline_upload|file=imag1.png|title=test]
  will be replaced with <img src="imag1.png" alt="test" />
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.