Extending content/action to support pre-filling of fields

Author Message

Gabriel Ambuehl

Friday 09 September 2005 1:39:24 pm

For a project I'm working on, pre-filling of some fields of a newly created object would be really helpful.

As I gather in content/action, this currently isn't really feasible. I thought about writing my own extension to this and be done with it, but ultimately, it would be much nicer, if content/action could handle it.

What I propose is the addition of a new POST parameter (named something like "FieldsToBePrefilled[]") that will contain the field identifiers of those fields for which the script would then try to fish the pre defined values from the POST query and apply them before redirecting the user to the edit view of the newly created object.

Thoughts?

PS: Part of the reason for posting this is to ask eZ if this could be included if I was to write it?

Visit http://triligon.org

Xavier Dutoit

Saturday 10 September 2005 4:57:40 am

Hi Gabriel,

Have a look at this extension:
http://ez.no/community/contribs/hacks/object_creator

I think I've modified a wee bit to cope with more attribute types. Have to check if I commited it on pubsvn (if it's there).

X+

http://www.sydesy.com

Aladdin Mouhaimeed

Sunday 11 September 2005 1:57:23 am

Xavier,I tried Object_Creator but it didn't work,
it really work in creating new ojects, but predefined parameters have no any effect,
if it works fine with you, please tell me.

Xavier Dutoit

Sunday 11 September 2005 1:24:02 pm

I tell you: it works ;).

Have a look at the doc. I tested with a 3.5.x install (no 3.6).

X+

http://www.sydesy.com

Gabriel Ambuehl

Monday 12 September 2005 12:54:27 am

Can't you simply use all attribute types? ez already knows how to deal with them after all...

Visit http://triligon.org

Aladdin Mouhaimeed

Monday 12 September 2005 1:29:25 am

Xavier, them maybe the reason is I use 3.6.1!!! (another possible reason is I missed something, maybe)

anyway, Gabriel, have you tried this:
http://ez.no/community/contribs/hacks/one_click_new_object_and_publish_preview_hack

this worked fine with me

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 22:37:30
Script start
Timing: Jan 18 2025 22:37:30
Module start 'layout'
Timing: Jan 18 2025 22:37:30
Module start 'content'
Timing: Jan 18 2025 22:37:30
Module end 'content'
Timing: Jan 18 2025 22:37:30
Script end

Main resources:

Total runtime0.0166 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 589.2891152.6563
Module start 'layout' 0.00630.0033 741.945339.5078
Module start 'content' 0.00960.0052 781.453193.3984
Module end 'content' 0.01480.0018 874.851634.3047
Script end 0.0165  909.1563 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002414.7672140.0002
Check MTime0.00116.5190140.0001
Mysql Total
Database connection0.00074.147810.0007
Mysqli_queries0.003621.957230.0012
Looping result0.00000.096510.0000
Template Total0.00148.610.0014
Template load0.00084.607110.0008
Template processing0.00073.998110.0007
Override
Cache load0.00053.091110.0005
General
dbfile0.00031.691780.0000
String conversion0.00000.070540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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