Share » Forums » Developer » Problem using eZYuiColorPicker with...

Problem using eZYuiColorPicker with eZContentFunctions::createAndPublishObject

Problem using eZYuiColorPicker with eZContentFunctions::createAndPublishObject

Monday 25 January 2010 8:44:13 am - 3 replies

Modified on Wednesday 24 March 2010 1:19:25 am by Damien MARTIN

Author Message

Damien Pobel

Monday 25 January 2010 3:40:21 pm

Hi Damien,

It seems that this datatype does not support the fromString/toString feature that's why you're attribute is always empty when you create your object with eZContentFunctions::createAndPublishObject(). The value of an ezyuicolorpicker attribute is stored in the data_text column so if you add the following fromString() method to the datatype class (the same as in the ezstring datatype in fact) it should work :

function fromString( $contentObjectAttribute, $string )
{
    return $contentObjectAttribute->setAttribute( 'data_text', $string );
}

Hope that helps.

Cheers

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

Damien MARTIN

Tuesday 26 January 2010 12:20:20 am

Thank you very much Damien,

It works very well !

Maybe it would be great to update the DataType to add the fromString to other users...

But the project seems to be abandoned since a long time.

Do you think we should create a new project on projects.ez.no ?
Or maybe the color picker will be added by default with eZ 4.3 ? (as I understood that the admin will be rewritten using AJAX and YUI).

Thanks,

Damien

Damien Pobel

Tuesday 26 January 2010 2:17:05 am

Feel free to create a project on http://projects.ez.no if you want to share your modiication. You can also contact the author of the project (Arnaud Georgin) to tell him that you put the extension on projects.ez.no.

I took a quick look at the extension code, I see some minor issues/possible improvements :

  • The code should be ported to PHP5 to not throw Strict errors messages
  • use ezjscore to load Javascript more quickly (if you use eZ Publish 4.2)
  • "Sélectionner une couleur :" label in the edit template can not translated

and there's probably others.

Cheers !

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

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

36 542 Users on board!

Forums menu