Path

ez projects / ezclasslists / forum / general / problem in 'view objects of...


Problem in 'View objects of this class' link

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

Elena Stoycheva

Member since:
09 September 2008

Posts: 5

Thursday 04 June 2009 11:54:11 am

Hi, Mr. Pobel,

Many thanks for sharing the new release of that great extension. I have already implemented it and tested its new features. However, in my opinion, there is one problem related to the 'View objects of this class' link in the popup menu in the nodes view full. The url of the link takes the numeric class ID of the current object and then the filtration of the objects of that class is made by that ID. I checked the source code of link.php and I saw that in it you check the class identifier value and if it is numeric you converted it this way:

if ( is_numeric( $classIdentifier ) )
{
$classIdentifier = eZContentClass::classIdentifierByID( $classIdentifier );
}

but the problem is that this function 'classIdentifierByID' is non-existing in the eZContentClass, at least I didn't find it. So, I added my custom fix as first I fetch the current class by it's numeric ID and then I take the value of the attribute Identifier of that class this way:

if ( is_numeric( $classIdentifier ) )
{
$class = eZContentClass::fetch( $classIdentifier, true, 0 );
$classIdentifier = $class->attribute( 'identifier' );
}

This is my solution, although it might not be the best, but in my case it works for fine for now. I hope you could help my with the key to this problem. I'm looking forward to your reply!

Best regards!
Up

Elena Stoycheva

Member since:
09 September 2008

Posts: 5

Monday 08 June 2009 3:51:02 pm

Hi,

I'm writing again, because I think that my previous post was not well-founded. I found out that this new release of the extension is compatible with the 4.1 version, however, I'm trying to implement it in 4.0. The solution that I posted previously works fine for 4.0 for now, so probably I could use it until the migration to version 4.1.
Up

André R.

Member since:
14 January 2008

Posts: 168

Monday 10 August 2009 10:47:12 am

If the logic is changed(using id internally instead of string), then you could use:



$classID = eZContentObjectTreeNode::classIDByIdentifier( $classIdentifier );



on both 4.0 and 4.1.
Up

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