Share » Forums » Install & configuration » Unable to upload objects with OE...

Unable to upload objects with OE 4.1.2 in eZ 3.5.1

Unable to upload objects with OE 4.1.2 in eZ 3.5.1

Saturday 02 September 2006 4:13:59 am - 2 replies

Author Message

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>

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu