Path

ez projects / ezoe / forum / general / [solved] poblem whith images


[SOLVED] Poblem whith images

You need to be logged in to post messages in the forums. New users may register here.

Davide Candita

Member since:
15 April 2010

Posts: 5

Thursday 15 April 2010 12:08:11 pm

Hi,
I have a problem with ezoe that I do not know how to solve.
When editing an object no image is displayed, but when it is published is displayed correctly. The images are displayed everywhere but not in the editor. Instead of the image is displayed the size (original, reference, small, ...) that is the property alt of the img tag that is created, but the src property is incorrect.

An example of img tag that is dynamically created by the editor is

<img id="eZObject_5587" title="img_home" src="/" mce_src="/" alt="original" view="embed" inline="false" height="" width="" align="middle">
Up

André R

Member since:
20 August 2005

Posts: 171

Friday 16 April 2010 10:42:39 am

Hi, can you post some more info on your setup?
ezp version, and is it an old site upgraded?
ezoe version
ezoe.ini settings if you have overriden it
image aliases on the setup if it is non standard
other non standard settings you might know about.


Also, check the source code of the edit page, the tag you posted is the one inside TinyMCE, so to determine if issue is caused by ezoe code or TinyMCE you need to look for encoded html output from ezoe xml input handler, long story short, look for "&lt;img id=" pattern within textarea tags.

--
ar

Up

Davide Candita

Member since:
15 April 2010

Posts: 5

Monday 19 April 2010 10:31:17 pm

Hello,
the version of eZ Publish is 4.1.4 and it is an installation that is an upgrade of two installations (3.8.10 and 3.10.1) together. Ezoe version is 5.0.4. The same problem occurs on two different machines and on one of these machines there are other installations (same versions of eZ Publish and eZOE) that work well. I don't have made changes to the file ezoe.ini.
There are many configurations, but I don't know what would cause problem to the editor. Ask me if there are specific configurations that I can provide to help you to help me.

The tag on the edit page is:




&lt;img id=&quot;eZObject_5129&quot; title=&quot;sediMAX logo&quot; src=&quot;/&quot; width=&quot;&quot; height=&quot;&quot; alt=&quot;original&quot; view=&quot;embed&quot; inline=&quot;false&quot; align=&quot;middle&quot; /&gt;




or more readable




<Img id="eZObject_5129" title="sediMAX logo" src="/" width="" height="" alt="original" view="embed" inline="false" align="middle" />




I think there is some javascript that is not loaded

Thanks
Davide
Up

André R

Member since:
20 August 2005

Posts: 171

Tuesday 20 April 2010 12:35:13 am

I don't think this is a js issue, but if you seen any errors in your javascript concole, please post them.

Anyway, to be able to understand this we need to debug a bit, here is a patch for ezoe to do just that:



Index: ezoe/ezxmltext/handlers/input/ezoexmlinput.php


===================================================================


--- ezoe/ezxmltext/handlers/input/ezoexmlinput.php      (revision 207)


+++ ezoe/ezxmltext/handlers/input/ezoexmlinput.php      (working copy)


@@ -1208,6 +1208,7 @@


                                $srcString  = $URL . '/' . $imageAlias['url'];


                                $imageWidth = $imageAlias['width'];


                                $imageHeight = $imageAlias['height'];


+                               eZDebug::writeDebug(var_export( array( $classAttribute->attribute( 'identifier' ), $dataTypeString, $size, $imageAlias ), true ), 'OE IMAGE' );


                                break;


                            }


                        }




Apply the patch and enable debugOutput in eZ Publish (or check debug.log after you have opened the edit view) and search for "OE IMAGE" if you get lots of debug info.
it will give you current class attribute identifier, datatype, size param and the actual raw image alias data.

--
ar

Up

Davide Candita

Member since:
15 April 2010

Posts: 5

Tuesday 20 April 2010 5:51:33 pm

Apparently we have found the problem, debug returns all array like this




array (


 0 => 'large_image',


 1 => 'ezimage',


 2 => 'original',


 3 => 

 array (


   'name' => 'original',


   'width' => '',


   'height' => '',


   'mime_type' => '',


   'filename' => '',


   'suffix' => '',


   'dirpath' => '',


   'basename' => '',


   'alternative_text' => '',


   'text' => '',


   'original_filename' => '',


   'url' => '',


   'alias_key' => '1293033771',


   'timestamp' => '1188994591',


   'full_path' => '',


   'is_valid' => '',


   'is_new' => false,


   'filesize' => false,


   'info' => false,


 ),


)




The array $imageAlias has almost all fields empty. What can cause this. How can I fix?

Thanks
Davide
Up

André R

Member since:
20 August 2005

Posts: 171

Wednesday 21 April 2010 7:47:19 am

Not sure, so think we need some more debug.
Change the line in patch above to:



if ( $imageAlias['url'] === '' )


eZDebug::writeDebug(var_export( array( $classAttribute->attribute( 'identifier' ), $dataTypeString, $size, $imageAlias, $contentObjectAttribute->attribute( 'data_text' ) ), true ), 'OE IMAGE' );


--
ar

Up

Davide Candita

Member since:
15 April 2010

Posts: 5

Wednesday 21 April 2010 6:15:38 pm

Is possible that some upgrade script hasn't worked as expected?
The debug output is now:



array (


 0 => 'large_image',


 1 => 'ezimage',


 2 => 'original',


 3 => 

 array (


   'name' => 'original',


   'width' => '',


   'height' => '',


   'mime_type' => '',


   'filename' => '',


   'suffix' => '',


   'dirpath' => '',


   'basename' => '',


   'alternative_text' => '',


   'text' => '',


   'original_filename' => '',


   'url' => '',


   'alias_key' => '1293033771',


   'timestamp' => '1188994503',


   'full_path' => '',


   'is_valid' => '',


   'is_new' => false,


   'filesize' => false,


   'info' => false,


 ),


 4 => '<?xml version="1.0" encoding="UTF-8"?>


<ezimage serial_number="1"


        is_valid=""


        filename=""


        suffix=""


        basename=""


        dirpath=""


        url=""


        original_filename=""


        mime_type=""


        width=""


        height=""


        alternative_text=""


        alias_key="1293033771"


        timestamp="1188994503">


 <original attribute_id="17997"


           attribute_version="1"


           attribute_language="eng-GB" />


</ezimage>',


)



Up

André R

Member since:
20 August 2005

Posts: 171

Thursday 22 April 2010 9:33:35 am

Hmm, maybe.
I think you should move this discussion to share.ez.no to get more people to see it, I think I have seen something like this before, but don't remember exactly what is was as I don't work that much on support.

For instance, what happens if you check all check boxes in setup/cache and clear them all (not clear all button, but checkboxes, as image alias is not part of clear all button). Be sure to have backup first, and I hope you have one from original version as well.

Edit: Related to this maybe? http://issues.ez.no/IssueView.php?Id=16703&activeItem=1

--
ar

Up

Davide Candita

Member since:
15 April 2010

Posts: 5

Friday 23 April 2010 4:45:48 pm

I found the problem!
The Image class of my site contains two ezimage attributes. The first is "large_image" and in almost all images is empty, the second is "image" and is the field that actually contains the image in all image objects.
I made this change to extension/ezoe/ezxmltext/handlers/input/ezoexmlinput.php to see images in the editor



1153a1154


>                          $hasContent = $contentObjectAttribute->hasContent();


1155c1156


<                            if ( $content != null && $content->hasAttribute( $size ) )


---


>                            if ( $hasContent && $content != null && $content->hasAttribute( $size ) )



But the popup still does not work unless I exchange the position of the two ezimage attributes.
We should also change the code that handles the popup.

Thanks for the suggestions.

Davide
Up

André R

Member since:
20 August 2005

Posts: 171

Monday 10 May 2010 1:29:50 pm

Thanks, fixed it in trunk and stable/5.1.
Basically there is a similar conditions in upload.php that needs this ->hasContent() check.
And there is also one in ezjscajaxcontent.php (also fixed in ezjscore trunk) in ezjscore extension that is used for preview on browse / search / bookmarks tabs.

--
ar

Up

You need to be logged in to post messages in the forums. New users may register here.