eZ Community » Forums » Developer » new datatype issues
expandshrink

new datatype issues

new datatype issues

Tuesday 04 October 2011 10:54:45 am - 4 replies

hi there,

i created a new datatype.. for the moment, it doesn't do anything, but i can't continue developing because i get always the same error:

PHP Fatal error:  Call to a member function attribute() on a non-object in /www/kernel/classes/ezcontentobjectattribute.php on line 505, referer: http://<domain>/ezadmin/class/classlist/5

i was looking for this error, and i found that my datatype doesn't have the attribute  contentclass_attribute_name..

this attribute will called from the file lib/eztemplate/classes/eztemplateattributeoperator.php (175)

any help?

Tuesday 04 October 2011 4:17:14 pm

Hello Juan,

I'm sorry your having trouble.

What existing datatype are you using as a basis for your custom datatype?

Perhaps this article on creating custom datatypes will help?

http://share.ez.no/layout/set/print/learn/ez-publish/creating-datatypes-in-ez-publish-4

I hope this helps ...

Cheers,

Heath

Tuesday 04 October 2011 4:29:05 pm

hi Heath,

actually, i was using this tutorial for reference. unfortunately the source code's are offline, i also looked for reference at the ezsurvey, ezflow and other natives datatypes.

cheers

Wednesday 05 October 2011 6:32:52 am

Hello Juan,

Apologies, I did not realize this before I shared this article.

I have attempted to contact the author Thomas and request the publication of the missing source code but I fear that too much time has passed and this may be another example lost in the internets. (Read his blog and find he seems to have moved beyond php)

This should serve as a real example of why it is often better for the community if example source code like this is published on projects.ez.no instead of personal revision control hosting sad.gif Emoticon

I would also consider reviewing the available datatypes published on projects.ez.no, re: http://projects.ez.no/types/ez_publish/datatype

I would prolly start the learning process by creating a very simple but custom copy of a very simple base datatype. Say like ezboolean, ezstring, ezinteger or even the differences between ezdate and ezdatetime. Those are what I think of when I think of simple getting started datatypes. And those are quite simple to copy customize and re-use as a basis for your own custom datatype. This way you know it works just like a native datatype + your additions. They really help you start from something which you can rest assured works right out of the box.

I've done this myself many times for specific customer request which required them (they are old but they are still online).

http://projects.ez.no/bcphonestring

http://projects.ez.no/bcpostalcode

http://projects.ez.no/bcstateselect

 

It might also help to review the core datatype PHP doxygen documentation,

http://pubsvn.ez.no/doxygen/trunk/html/classeZStringType.html

http://pubsvn.ez.no/doxygen/trunk/html/classeZIntegerType.html

 

Pay close attention to observing eZ Publish PHP standards, conventions and patterns.

These conventions and patterns (php class name, settings, etc) are key to ensuring your datatype is detected and used properly. 

I hope this helps...

Cheers,

Heath

Wednesday 05 October 2011 9:26:30 am

hi again,

i still don't find the error, but i have done a new datatype (as you recommended) wich only save the object_id, and it works..

thanks for the help

cheers

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from