Nathan Kelly
|
Sunday 06 November 2005 7:37:00 pm
Hi all, I've set up some user accounts and have made a "my profile" link the same as the ez.no site, this links to user/edit/[id] and this page works fine. However when I go to the edit profile page content/edit/[id] my page layout falls apart. Basically anything that is fetched on the pagelayout.tpl disappears leaving only the static content and the content/edit form. I noticed in the content/edit url there is a version number added /content/edit/[id]/2. Could this have something to do with it? Also the email sent to the user contains a url to content/view/full/[id]. This url displays a message saying "Unable to register new user" with a back button. My registered user roles are:
user login SiteAccess( site )
content read Section( Restricted )
content edit Subtree( Users ) , Class( User ) , Section( Users ) , Owner( Self )
content read Subtree( Users ) , Class( User ) , Section( Users ) , Owner( Self )
user password No limitations
user preferences No limitations
user selfedit No limitations
I have assigned my anonymous roles to the restricted roles to allow logged in users to view the un restricted areas as well. What could I be missing? Could anybody walk me through the possibilities please? Cheers!
Pardon me while I burst into flames...
|
Nathan Kelly
|
Sunday 06 November 2005 9:08:11 pm
A few other things I have noticed while browsing around pages that are not a part of my content structure (like search pages, user profile pages etc) is that I am getting these errors as follows:
Error: eZTemplate Nov 07 2005 16:00:14
No such attribute for array(7): node_id
Choose one of following: content, path, is_default_navigation_part,
navigation_part, ui_context, ui_component,
uri
Warning: PHP Nov 07 2005 16:00:14
Undefined offset: 4 in /home/cctscom/public_html/kernel/common/eztreemenuoperator.php on line 110
Error: eZMySQLDB Nov 07 2005 16:00:14
Query error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND
ezcontentobject_tree.contentobject_id=ezcontentobjec' at line 10. Query: SELECT ezcontentobject.*,
ezcontentobject_tree.*,
ezcontentclass.name as class_name,
ezcontentclass.identifier as class_identifier
, ezcontentobject_name.name as name, ezcontentobject_name.real_translation
FROM ezcontentobject_tree,
ezcontentobject,
ezcontentclass
, ezcontentobject_name
WHERE node_id IN ( ) AND
ezcontentobject_tree.contentobject_id=ezcontentobject.id AND
ezcontentclass.version=0 AND
ezcontentclass.id = ezcontentobject.contentclass_id
and ezcontentobject_tree.contentobject_id = ezcontentobject_name.contentobject_id and
ezcontentobject_tree.contentobject_version = ezcontentobject_name.content_version and
ezcontentobject_name.content_translation = 'eng-AU'
Notice: eZMySQLDB::query(0.000 ms) query number per page:1 Nov 07 2005 16:00:14
SELECT ezcontentobject.*,
ezcontentobject_tree.*,
ezcontentclass.name as class_name,
ezcontentclass.identifier as class_identifier
, ezcontentobject_name.name as name, ezcontentobject_name.real_translation
FROM ezcontentobject_tree,
ezcontentobject,
ezcontentclass
, ezcontentobject_name
WHERE node_id IN ( ) AND
ezcontentobject_tree.contentobject_id=ezcontentobject.id AND
ezcontentclass.version=0 AND
ezcontentclass.id = ezcontentobject.contentclass_id
and ezcontentobject_tree.contentobject_id = ezcontentobject_name.contentobject_id and
ezcontentobject_tree.contentobject_version = ezcontentobject_name.content_version and
ezcontentobject_name.content_translation = 'eng-AU'
Warning: PHP Nov 07 2005 16:00:14
Undefined offset: 1 in /home/cctscom/public_html/kernel/common/eztreemenuoperator.php on line 115
I think these errors are related to my treemenus in my pagelayout.tpl. Does anyone know what would be causing these errors, as I said they only appear when I'm not on a node within my content structure, or the media library and user accounts nodes? Do I need to change my pagelayout.tpl for the search and user profile pages? I really need some advice on this if you can help. Thanks in advance...
Pardon me while I burst into flames...
|
Nathan Kelly
|
Tuesday 08 November 2005 6:56:10 pm
Hi Bruce, on my user profile page "user/edit/[id]" my debug output is as follows:
Timing: Nov 09 2005 13:46:02
Script start
Notice: eZMySQLDB::query(0.000 ms) query number per page:0 Nov 09 2005 13:46:02
SET NAMES 'utf8'
Timing: Nov 09 2005 13:46:02
Module start 'user'
Timing: Nov 09 2005 13:46:02
Module end 'user'
Error: eZTemplate Nov 09 2005 13:46:02
No such attribute for array(6): node_id
Choose one of following: content, path, is_default_navigation_part,
ui_context, ui_component, uri
Error: eZMySQLDB Nov 09 2005 13:46:02
Query error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND
ezcontentobject_tree.contentobject_id=ezcontentobjec' at line 10. Query: SELECT ezcontentobject.*,
ezcontentobject_tree.*,
ezcontentclass.name as class_name,
ezcontentclass.identifier as class_identifier
, ezcontentobject_name.name as name, ezcontentobject_name.real_translation
FROM ezcontentobject_tree,
ezcontentobject,
ezcontentclass
, ezcontentobject_name
WHERE node_id IN ( ) AND
ezcontentobject_tree.contentobject_id=ezcontentobject.id AND
ezcontentclass.version=0 AND
ezcontentclass.id = ezcontentobject.contentclass_id
and ezcontentobject_tree.contentobject_id = ezcontentobject_name.contentobject_id and
ezcontentobject_tree.contentobject_version = ezcontentobject_name.content_version and
ezcontentobject_name.content_translation = 'eng-AU'
Notice: eZMySQLDB::query(0.000 ms) query number per page:1 Nov 09 2005 13:46:02
SELECT ezcontentobject.*,
ezcontentobject_tree.*,
ezcontentclass.name as class_name,
ezcontentclass.identifier as class_identifier
, ezcontentobject_name.name as name, ezcontentobject_name.real_translation
FROM ezcontentobject_tree,
ezcontentobject,
ezcontentclass
, ezcontentobject_name
WHERE node_id IN ( ) AND
ezcontentobject_tree.contentobject_id=ezcontentobject.id AND
ezcontentclass.version=0 AND
ezcontentclass.id = ezcontentobject.contentclass_id
and ezcontentobject_tree.contentobject_id = ezcontentobject_name.contentobject_id and
ezcontentobject_tree.contentobject_version = ezcontentobject_name.content_version and
ezcontentobject_name.content_translation = 'eng-AU'
Timing: Nov 09 2005 13:46:02
End
Whereas on my change details page "content/edit/[id]/[version]" my output shows:
Timing: Nov 09 2005 13:47:46
Script start
Notice: eZMySQLDB::query(0.000 ms) query number per page:0 Nov 09 2005 13:47:46
SET NAMES 'utf8'
Timing: Nov 09 2005 13:47:46
Module start 'content'
Timing: Nov 09 2005 13:47:46
Module end 'content'
Error: eZTemplate Nov 09 2005 13:47:46
No such attribute for array(7): node_id
Choose one of following: content, path, navigation_part, is_default_navigation_part,
ui_context, ui_component, uri
Timing: Nov 09 2005 13:47:46
End
Also I have two treemenus on the pagelayout.tpl, one for my main navigation which should always be present and one for my sub navigation which should only appear in certain sections. The menus are as follows: Main navigation:
<div id="main-nav">
<div class="wrapper">
<p class="skip-nav"><a href="#content" title="Main navigation - skip to content.">{"Main navigation - skip to content"|i18n( "design/ccts" )}</a></p>
<ul>
{def $main_menu=treemenu($module_result.path,
$module_result.node_id,
array('folder'), 0, 1 ) }
{foreach $main_menu as $m_menu}
<li><a{$m_menu.is_selected|choose('',' class="current"')} href={$m_menu.url_alias|ezurl}>{$m_menu.text}</a></li>
{/foreach}
{undef}
</ul>
</div>
<div class="nav-end"></div>
<hr />
</div>
Sub Navigation:
<div id="sub-nav">
{def $sub_nav_needed=array(1,8,9,6,10,11)}
{if $sub_nav_needed|contains($module_result.section_id) show=$sub_nav_needed}
<p class="skip-nav"><a href="#content" title="Sub navigation - skip to content.">{"Sub navigation - skip to content"|i18n( "design/ccts" )}</a></p>
<ul>
{def $sub_menu=treemenu($module_result.path,
$module_result.node_id,
array('standard_page','folder','contact_form','sub_page'), 1, 2)}
{def $last=0}
{foreach $sub_menu as $s_menu}
{if and($last|ne(0), $last.level|gt($s_menu.level))}
</ul>
</li>
{/if}
<li>
{if and($last|ne(0), $last.level|lt($s_menu.level))}
<ul>
<li>{/if}<a{$s_menu.is_selected|choose('',' class="current"',' class="current-parent"')} href={$s_menu.url_alias|ezurl}>{$s_menu.text}</a></li>
{set last=$s_menu}
{/foreach}
</ul>
{else}
{* Sub Nav Not Needed *}
{/if}
{undef}
{include uri="design:service_menu.tpl"}
<hr />
</div>
When I view my edit profile page "content/edit/[id]/[version]" my tree menus and any other fetched data (within pagelayout.tpl) is lost, so my whole site breaks down exept for the edit form. I hope you can help, I know its hard when you cant see it. Cheers!
Pardon me while I burst into flames...
|
Nathan Kelly
|
Tuesday 08 November 2005 8:13:40 pm
So are you saying that the treemenus in my pagelayout.tpl are incorrect? I've never had a problem with them until now. The main nav is present when viewing "content/advancedsearch", "content/search", "user/edit" and every "content/view" page, the only page that loses the navigation is "content/edit". What I don't understand is why "content/edit" handles the pagelayout.tpl differently? Is there an /ini setting I could be missing perhaps? I know in reality a user may not need to use the main navigation while editing but the problem is that the main nav makes up a significant part of the header layout of the page, when it vanishes the site looks completely broken, so it needs to be there regardless. How do eZ systems do it? Their pagelayout stays intact when viewing "content/edit" and I assume they use the treemenu operator for the navigation. I'll play with the treemenus and see what I can come up with but in the mean time any other input is welcome (needed). Thanks for your input so far Bruce.
Pardon me while I burst into flames...
|
Bruce Morrison
|
Tuesday 08 November 2005 9:01:41 pm
Hi Nathan For one reason or the other it appears that $module_result.node_id is not set when editing content. I must admit that I don't use the treemenu function so I do not have much experience with it. I tend to use fetches to do Nav stuff. You can replace your main nav with something like
<ul>
{def
$home=fetch(content, node, hash(node_id,2))
$main_menu=fetch(content, list,
hash(parent_node_id,2,
sort_by,$home.sort_array,
class_filter_type,include,
class_filter_array,array('folder')
)
)
}
{foreach $main_menu as $m_menu}
<li><a{if eq($module_result.path[$home.depth].node_id,$m_menu.node_id)} class="current{/if} href={$m_menu.url_alias|ezurl}>{$m_menu.text}</a></li>
{/foreach}
{undef}
</ul>
HTH Bruce
My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish
|
Nathan Kelly
|
Tuesday 08 November 2005 9:37:38 pm
Hi Bruce, well the good news is using your fetch function for the main menu removes the errors on all of the pages where there were errors. The bad news is I can't seem to get it to show the menu? There was one little error in the code, you missed the closing " at class="current but I fixed this and checked the rest of the fetch, it looks ok to me, but still no joy. The variable you have in the first fetch ($topnode_id) should this remain the same or do I need to specify something different here? I'll keep hacking at it, I think if I can get this working I'll stop using tremenus from now on! Cheers!
Pardon me while I burst into flames...
|