Forums / Developer / Problem creating content object

Problem creating content object

Author Message

Thomas Negeli

Tuesday 02 March 2010 12:55:12 am

Hi Community,

I have a problem creating content objects in the users area.

I have to dynamically create user objects, because authentication runs via an external third party system. This works by now. I can create the users in eZPublish with the data filled automatically and than view them in the admin siteaccess, so to say in the backend. The data is displayed correctly.

When I want to access the same user data in the frontend I only get displayed parts of the data from the user. I can for example read his first_name, last_name and useraccount attributes. But I can't access additionall attributes I have crated for the user class (landline (string), fax (string), bill_data (Matrix), ...). They are there, but an Integer Attribute for example always is 0. The strange thing is, that I can read all this additional attributes in the admin siteaccess with the right data, so I think I have created everything right so far.

What I do is the following:

  1. $ezpublishUser = eZUser :: fetchByName('externalUserName')
  2. $contentObject = eZContentObject::fetch($ezpublishUser->attribute('contentobject_id'));
  3. $dataMap = $contentObject->attribute('data_map');

At this point I think I can access the attribute I have crated ('imagine_user_id') via

  • $imagineUserId = $dataMap['imagine_user_id']->attribute('data_int');

but it is always 0 in the frontend. The right value is displayed in the backend.

I have created the user before with the following lines ($params need to be right because the user is created correctly):

  1. $contentObject = eZContentFunctions :: createAndPublishObject($params);
  2. $existUser = eZUser::fetch($contentObject->attribute('id'));
  3. $existUser->setAttribute('login', $login);
  4. $existUser->setAttribute('email', $imagineUser['email'] );
  5. $existUser->setAttribute('password_hash', md5($password) );
  6. $existUser->setAttribute('password_hash_type', eZUser::PASSWORD_HASH_MD5_PASSWORD );
  7. $existUser->store();

I tried

  • eZContentCacheManager :: clearObjectViewCache( $contentObject->attribute('id') );
  • eZContentCacheManager :: clearAllContentCache(true);

but it didn't change anything. Any idea?

Cheers

Thomas

Thomas Negeli

Tuesday 02 March 2010 4:57:10 am

News: if I edit the data of a user in the backend, I can display all data in the frontend correctly.

Only my selfcreated users are not displayed correctly.

Why this?

eZ debug

Timing: Jan 30 2025 19:52:39
Script start
Timing: Jan 30 2025 19:52:39
Module start 'content'
Timing: Jan 30 2025 19:52:39
Module end 'content'
Timing: Jan 30 2025 19:52:40
Script end

Main resources:

Total runtime0.3087 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0078 587.9297370.2969
Module start 'content' 0.00780.0291 958.22661,001.5938
Module end 'content' 0.03690.2717 1,959.82033,896.9375
Script end 0.3086  5,856.7578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00491.5994200.0002
Check MTime0.00140.4614200.0001
Mysql Total
Database connection0.00090.306810.0009
Mysqli_queries0.186560.42431410.0013
Looping result0.00210.68651390.0000
Template Total0.271287.910.2712
Template load0.00100.320110.0010
Template processing0.270287.549610.2702
Override
Cache load0.00070.221010.0007
Sytem overhead
Fetch class attribute can translate value0.00230.756510.0023
XML
Image XML parsing0.00020.063510.0002
General
dbfile0.01856.0028200.0009
String conversion0.00000.002030.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs