Change class type of users?

Author Message

Marco Rogers

Monday 15 November 2010 2:10:10 pm

The users in my database are one of 2 class types. The default User or a new Visitor class that we originally created for a different feature. We have scrapped that feature and would now like to convert all Visitor Objects to User objects. What's the easiest way to do this. I would like to avoid doing a migration in PHP.

Can I change the class identifier in the database? Will that work properly or will this put the objects into an inconsistent state?

FYI, the attributes are mirrored between the two classes so as long as the attributes are still attached after the transition, I shouldn't need to mess with those. I'm only concerned about switching the class type of the user content object.

Thanks

:Marco

Heath

Monday 15 November 2010 9:34:55 pm

Hello Marco,

I seem to remember an older contribution that provide this functionality.

I found it! http://projects.ez.no/object_content_class_change

I see it has not been updated in a long time though.

It would be nice if it could be updated for use with eZ Publish 4.x/4.4

Cheers,

Heath

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

paul bolger

Wednesday 17 November 2010 10:31:37 pm

I used object_content_class_change on a site a couple of years ago and it worked really well, not sure about now. I'd definitely not use it on a live site though...

That sort of functionality really should be in the core of eZ.

Paul Bolger

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 02:56:46
Script start
Timing: Jan 18 2025 02:56:46
Module start 'layout'
Timing: Jan 18 2025 02:56:46
Module start 'content'
Timing: Jan 18 2025 02:56:47
Module end 'content'
Timing: Jan 18 2025 02:56:47
Script end

Main resources:

Total runtime0.7764 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 587.9141152.6250
Module start 'layout' 0.00630.0034 740.539139.4531
Module start 'content' 0.00970.7655 779.9922571.9453
Module end 'content' 0.77510.0013 1,351.937512.1641
Script end 0.7764  1,364.1016 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4323160.0002
Check MTime0.00140.1810160.0001
Mysql Total
Database connection0.00100.128710.0010
Mysqli_queries0.723593.1859600.0121
Looping result0.00050.0587580.0000
Template Total0.740995.420.3705
Template load0.00230.298820.0012
Template processing0.738695.123820.3693
Template load and register function0.00010.015310.0001
states
state_id_array0.00120.160310.0012
state_identifier_array0.00080.097520.0004
Override
Cache load0.00190.2473220.0001
Sytem overhead
Fetch class attribute can translate value0.00040.055630.0001
Fetch class attribute name0.00100.133650.0002
XML
Image XML parsing0.00100.131630.0003
class_abstraction
Instantiating content class attribute0.00000.001250.0000
General
dbfile0.00660.8504230.0003
String conversion0.00000.001040.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs