Lines 387 and 388 in the inline module (v. 5.x-1.0):

if (isset($node->files[$filekeys[$match[2] - 1]]['filename'])) {
$filename = $node->files[$filekeys[$match[2] - 1]]['filename'];

['filename'] should be replaced by ->filename here, or otherwise you get a php error with php5

Noticed this problem in the 4.7 version of inline, but it seems to be unchanged throughout all more recent versions.

CommentFileSizeAuthor
#4 inline_6.patch2.51 KBsun

Comments

pfaocle’s picture

Priority: Normal » Critical

Yep, got this one too. Had to go back to a 1.x-dev version from February.

Marking critical, as it completely broke sites with a PHP error.

sun’s picture

Assigned: Unassigned » sun

@leafish_paul: Are you on php5, too?

I'm asking because I don't get this error on php4.

pfaocle’s picture

Yes: PHP Version 5.2.1

sun’s picture

Status: Active » Needs review
StatusFileSize
new2.51 KB

Could you please test this patch?

NaSPA1’s picture

I'm also running php 5.2.1. It took care of the stdClass error - but the graphic is still not being displayed. :(

Radi

sun’s picture

@Ivanput / leafish_paul: Did the patch work for you?

@NaSPA1: Images not showing up can have many more reasons. What do you mean by 'image not being displayed'? Is there a file link instead of an image? Did you check your maximum image dimensions in Inline settings?

pfaocle’s picture

The patch (against 1.0) at least sorts out the critical error, yes. The module still isn't inserting images, however, but I'm assuming this is a problem elsewhere. I'm busy, so haven't tested this thoroughly (or with, say, more than one attached image, auto-displayed). My settings seem present and correct: display image only, maximum 400,400.

If I turn 'image with link' on, I get:

<a href="http://paul.leafish.co.uk/system/files/greg_pattillo.jpg" class="inline-image-link" title="View: greg_pattillo.jpg"></a>

in the source, but still no image. I'm using tags only, but auto-inserting images doesn't work either, after a quick test.

Sorry I've not delved any deeper (yet).

pfaocle’s picture

Ah, ignore me: this could be down to this issue.,, I applied the patch against the 1.0 release. I take it this fix is only in the 5.x-1.x-dev branch at the moment?

Will re-patch from the dev branch and report back when I can.

sun’s picture

yay, I forgot that other issue, too ;)
If it's working now, just post a time-saving 'yes' and I'll push the button.

pfaocle’s picture

OK, I reckon this one does fix the described issue here (I have re-tried with the 1.x-dev branch, and the critical PHP error is sorted) but I cannot really confirm as I think there are problems elsewhere with paths (I am using private files with the files directory set one directory above the 'Drupal root', ie ../files). I have posted a new issue here regarding this, and I'll try to follow that up this week.

sun’s picture

Title: Cannot use object of type stdClass as array » fatal error in inline_replace_numbers() on PHP5
Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)