Unable to upload objects with OE 4.1.2 in eZ 3.5.1

Author Message

Torgeir Fritsvold

Saturday 02 September 2006 4:13:59 am

For various reasons we're still using eZ 3.5.1 and when I installed a new site I wanted to use the latest version of the OE. The requirements state that OE runs on eZ 3.5 and up, so it should work fine.

When I try the OE it does work, but when I try to insert an object the pop-up appears to be empty. Viewing the HTML source reveals a page with normal eZ headers, but an empty body section. The body tag has an Init-function which is called when the page is loaded, but the Javascript console in Firefox says "Init is not defined". Trying the same thing in IE gives a Script Error: "Object expected" at the same location in the HTML file.

Anyone know why this happens? Should I downgrade to an earlier version of OE? (I don't really want to do this as I'd like to have the latest bugfixes, but if 4.1.2 is incompatible with eZ 3.5.1 I guess I might have to...)

André R.

Monday 04 September 2006 6:33:21 am

In
extension/ezdhtml/design/standard/templates/ezdhtml/insertobject.tpl
and insertobject_gecko.tpl

foreach and if is being used, thats why.(they are 3.6+ code style)
You can change it to 3.5 code yourself or it will probably be fixed in next version.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Kirill Subbotin

Friday 08 September 2006 9:53:10 am

Yes, this seems to be a bug. Gonna be ok in OE 4.1.3. Meanwhile here is the patch, please check it.

This patch also includes fix for bug #8985 (Uploading of an object under the current object doesn't work properly).

Index: design/standard/templates/ezdhtml/insertobject.tpl
===================================================================
--- design/standard/templates/ezdhtml/insertobject.tpl  (revision 15077)
+++ design/standard/templates/ezdhtml/insertobject.tpl  (working copy)
@@ -18,27 +18,27 @@
 <label>{"Location"|i18n("design/standard/ezdhtml")}:</label>
 <select name="location">
 <option value="auto">{"Automatic"|i18n("design/standard/ezdhtml")}</option>
-    {def $root_node_value=ezini( 'LocationSettings', 'RootNode', 'upload.ini' )
+    {let $root_node_value=ezini( 'LocationSettings', 'RootNode', 'upload.ini' )
          $root_node=cond( $root_node_value|is_numeric, fetch( content, node, hash( node_id, $root_node_value ) ),
                          fetch( content, node, hash( node_path, $root_node_value ) ) )
          $content_object=fetch( content, object, hash( object_id, $object_id  ) )}
-    {section show=$content_object.current_version|gt(1)}
+    {section show=$content_object.published}
      <option value="{$content_object.main_node_id}">{$content_object.name}</option>
     {/section}
-       {def $selection_list=fetch( 'content', 'tree',
+       {let $selection_list=fetch( 'content', 'tree',
                                  hash( 'parent_node_id', $root_node.node_id,
                                        'class_filter_type', include,
                                        'class_filter_array', ezini( 'LocationSettings', 'ClassList', 'upload.ini' ),
                                        'depth', ezini( 'LocationSettings', 'MaxDepth', 'upload.ini' ),
-                                                                               'depth_operator', 'lt',
+                                                                      'depth_operator', 'lt',
                                        'limit', ezini( 'LocationSettings', 'MaxItems', 'upload.ini' ) ) )}

-               {foreach $selection_list as $selection}
-               {if $selection.can_create}
-                <option value="{$selection.node_id}">{'&nbsp;'|repeat( sub( $selection.depth, $root_node.depth, 1 ) )}{$selection.name|wash}</option>
-               {/if}
-               {/foreach}
-    {undef $root_node_value $root_node $selection_list $content_object $selection_first}
+               {section loop=$selection_list}
+               {section show=$item.can_create}
+                <option value="{$item.node_id}">{'&nbsp;'|repeat( sub( $item.depth, $root_node.depth, 1 ) )}{$item.name|wash}</option>
+               {/section}
+               {/section}
+    {/let}{/let}
 </select>
 </div>

Index: design/standard/templates/ezdhtml/insertobject_gecko.tpl
===================================================================
--- design/standard/templates/ezdhtml/insertobject_gecko.tpl    (revision 15077)
+++ design/standard/templates/ezdhtml/insertobject_gecko.tpl    (working copy)
@@ -25,27 +25,26 @@
 <label>{"Location"|i18n("design/standard/ezdhtml")}:</label>
 <select name="location">
 <option value="auto">{"Automatic"|i18n("design/standard/ezdhtml")}</option>
-    {def $root_node_value=ezini( 'LocationSettings', 'RootNode', 'upload.ini' )
+    {let $root_node_value=ezini( 'LocationSettings', 'RootNode', 'upload.ini' )
          $root_node=cond( $root_node_value|is_numeric, fetch( content, node, hash( node_id, $root_node_value ) ),
                          fetch( content, node, hash( node_path, $root_node_value ) ) )
          $content_object=fetch( content, object, hash( object_id, $object_id  ) )}
-    {section show=$content_object.current_version|gt(1)}
+    {section show=$content_object.published}
      <option value="{$content_object.main_node_id}">{$content_object.name}</option>
     {/section}
-       {def $selection_list=fetch( 'content', 'tree',
+       {let $selection_list=fetch( 'content', 'tree',
                                  hash( 'parent_node_id', $root_node.node_id,
                                        'class_filter_type', include,
                                        'class_filter_array', ezini( 'LocationSettings', 'ClassList', 'upload.ini' ),
                                        'depth', ezini( 'LocationSettings', 'MaxDepth', 'upload.ini' ),
                                                                           'depth_operator', 'lt',
                                        'limit', ezini( 'LocationSettings', 'MaxItems', 'upload.ini' ) ) )}
-
-        {foreach $selection_list as $selection}
-               {if $selection.can_create}
-                <option value="{$selection.node_id}">{'&nbsp;'|repeat( sub( $selection.depth, $root_node.depth, 1 ) )}{$selection.name|wash}</option>
-               {/if}
-               {/foreach}
-    {undef $root_node_value $root_node $selection_list $content_object $selection_first}
+        {section loop=$selection_list}
+               {section show=$item.can_create}
+                <option value="{$item.node_id}">{'&nbsp;'|repeat( sub( $item.depth, $root_node.depth, 1 ) )}{$item.name|wash}</option>
+               {/section}
+        {/section}
+    {/let}{/let}
 </select>
 </div>

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.