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?

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 15:14:50
Script start
Timing: Jan 18 2025 15:14:50
Module start 'layout'
Timing: Jan 18 2025 15:14:50
Module start 'content'
Timing: Jan 18 2025 15:14:50
Module end 'content'
Timing: Jan 18 2025 15:14:50
Script end

Main resources:

Total runtime0.6064 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 587.9141152.6250
Module start 'layout' 0.00540.0031 740.539139.4453
Module start 'content' 0.00850.5967 779.9844438.2266
Module end 'content' 0.60520.0011 1,218.21098.1641
Script end 0.6064  1,226.3750 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.5125160.0002
Check MTime0.00130.2091160.0001
Mysql Total
Database connection0.00080.127210.0008
Mysqli_queries0.563692.9491520.0108
Looping result0.00040.0595500.0000
Template Total0.577395.220.2887
Template load0.00220.362720.0011
Template processing0.575194.840420.2876
Template load and register function0.00010.019310.0001
states
state_id_array0.00090.149910.0009
state_identifier_array0.00090.141720.0004
Override
Cache load0.00180.3037360.0001
Sytem overhead
Fetch class attribute can translate value0.00030.055910.0003
Fetch class attribute name0.00100.157020.0005
XML
Image XML parsing0.00010.017710.0001
class_abstraction
Instantiating content class attribute0.00000.000720.0000
General
dbfile0.00160.2641100.0002
String conversion0.00000.001340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
2content/datatype/view/ezxmltags/ol.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ol.tplEdit templateOverride template
2content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs