Unique values at attributes

Author Message

Jorge estévez

Tuesday 09 March 2010 8:33:01 am

Hello to all,

How to make a unique data entry for an attribute while creating/populating an object in de admin site?

 

I would like that when the user adds a attribute “Product-Code” that is already taken “something” will tell him that the code is already used and that he is making a mistake or not to let him add the code.

 

Please take into consideration that the site is built with ezpublish 3.10.0 so extensions for older versions of the site will not work. Anyway if you could point out some code I an reuse, go ahead!

 

thanks

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

Jean-Luc Nguyen

Wednesday 17 March 2010 7:20:42 am

Hello there,

You could use jQuery module call to check if a product reference is already in the DB when the user is editing the reference attribute.

This could be done by calling a custom JS on backend that calls a check module.

http://www.acidre.com

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:55:15
Script start
Timing: Jan 18 2025 02:55:15
Module start 'layout'
Timing: Jan 18 2025 02:55:15
Module start 'content'
Timing: Jan 18 2025 02:55:16
Module end 'content'
Timing: Jan 18 2025 02:55:16
Script end

Main resources:

Total runtime1.3821 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 587.9141152.6250
Module start 'layout' 0.00550.0044 740.539139.4453
Module start 'content' 0.01001.3706 779.9844519.9531
Module end 'content' 1.38060.0015 1,299.93758.1641
Script end 1.3820  1,308.1016 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2373160.0002
Check MTime0.00130.0966160.0001
Mysql Total
Database connection0.00070.050910.0007
Mysqli_queries1.337696.7822540.0248
Looping result0.00080.0612520.0000
Template Total1.335296.620.6676
Template load0.00200.143620.0010
Template processing1.333296.463620.6666
Template load and register function0.00020.015110.0002
states
state_id_array0.00230.169210.0023
state_identifier_array0.00180.127820.0009
Override
Cache load0.00160.1142160.0001
Sytem overhead
Fetch class attribute can translate value0.00050.037620.0003
Fetch class attribute name0.00110.076630.0004
XML
Image XML parsing0.00060.042820.0003
class_abstraction
Instantiating content class attribute0.00000.000630.0000
General
dbfile0.00160.1155160.0001
String conversion0.00000.000440.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
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 7
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs