this is a cummulative patch. http://drupal.org/node/82697 and the preview is fixed.

Comments

he_who_shall_not_be_named’s picture

StatusFileSize
new319 bytes

It needs this file 'image.php' in the inline directory

Bèr Kessels’s picture

AFAIK I already fixed the previews in HEAD (runs on Drupal 4.7)

sun’s picture

Status: Needs review » Closed (fixed)

yes, already contained in inline HEAD (4.7 compatible) without the need for an additional php file.

he_who_shall_not_be_named’s picture

Status: Closed (fixed) » Active

You are wrong. The temporary directory is not accessible for the browser on 99% of cases. So, becouse the preview link contains an image from that directory, this will not work only on systems which permits browser access to the temporary directory (very unsafe). That is why the php is included. Please do a deeper test.inline

he_who_shall_not_be_named’s picture

This patch is for the HEAD. :)

sun’s picture

Priority: Critical » Normal

1. What kind of "preview" are you talking about? Inline does not support any kind of preview ATM.
2. By using the term "temporary directory", do you mean private file access configured through Drupal file settings?
3. If you provide patches, only include changes for one issue please, so everyone is able to relate to code changes for that issue.

he_who_shall_not_be_named’s picture

1) I am talking about the node preview (blog, story ...)
2) Hm. The old code contains a file_directory_temp(). see: http://api.drupal.org/api/HEAD/function/file_directory_temp

$tmp = file_directory_temp();
 if (strpos($file->filepath, $tmp) === 0) {
   $file->real_path = $file->filepath;
   $file->filepath = $file->filename;
   $file->preview = TRUE;
 }

I did't mean the private access.
The returned src for the old code, in previews, will be a temporary file from a temporary directory (/tmp) accessible by Drupal but not for the browser.

3) Sorry for that but I have no cvs and I compared my previously fixed code with the HEAD.

he_who_shall_not_be_named’s picture

To reproduce add/edit a post, upload a new image and press preview. The preview works for previously submitted nodes (because images are copied from the /tmp to the drupal_site/files on submit).

Bèr Kessels’s picture

Status: Active » Closed (duplicate)

The patch here fixed this: http://drupal.org/node/63826 please move over there and see wether that fix had problems of some kind, that I am not aware of.

he_who_shall_not_be_named’s picture

Status: Closed (duplicate) » Active

It is not fixed. Do a test with the temporary directory (/tmp) inaccessible for the browser. See my previous comments.

sun’s picture

An easy fix for this is to use a temporary directory that is accessible to the webserver/end user.

If we want to get this in, we need a integrated solution. For example, I could imagine to render new attached image uploads with src="inline/upload/filename.ext" that is processed by a new inline menu item registered with the path inline/upload.
I don't know if upload.module already provides streaming functions. If it does, we should use them instead.

sun’s picture

Title: inline: the preview doesn't work » inlined images not displayed in preview
Assigned: Unassigned » sun
Status: Active » Needs review
StatusFileSize
new762 bytes

Attached patch should fix this issue leveraging the Drupal framework. Please test.

I could not reproduce this issue - maybe this is because I'm on Windows or was just testing against a local Drupal installation. The introduced code could be moved to inline_prepare_file_object(), though.

sun’s picture

@vrencianz: Have you been able to test the latest patch?

he_who_shall_not_be_named’s picture

I didn't test it because I'm using a modified version of it.

sun’s picture

Status: Needs review » Closed (duplicate)

Reverting status.