Problem with updateActorEvents method

3 views
Skip to first unread message

Jesús García Crespo

unread,
May 23, 2009, 9:57:35 AM5/23/09
to Qubit Toolkit Developers
When you are adding or modifying an information object, you must
select a event type for each date introduced or a PropelException will
be triggered with the next error message:

Unable to execute INSERT statement. [wrapped: SQLSTATE[23000]:
Integrity constraint violation: 1452 Cannot add or update a child row:
a foreign key constraint fails (`qubit/q_event`, CONSTRAINT
`q_event_FK_2` FOREIGN KEY (`type_id`) REFERENCES `q_term` (`id`) ON
DELETE CASCADE)]

Through future client-side validation, users could be warned about
this data dependence. Meanwhile, I propose to drop events where type
was not selected as a simple solution:

Index: apps/qubit/modules/informationobject/actions/
editAction.class.php
===================================================================
--- apps/qubit/modules/informationobject/actions/
editAction.class.php (revision 2587)
+++ apps/qubit/modules/informationobject/actions/
editAction.class.php (working copy)
@@ -654,0 +655,2 @@
+ // Drop event creation if event type was not defined
+ if (!$eventFormData['eventTypeId']) continue;

Peter Van Garderen

unread,
May 25, 2009, 12:13:50 PM5/25/09
to qubi...@googlegroups.com
The correct behaviour for this should be to default to 'creation' as the
event type (e.g. eventTypeId = QubitTerm::CREATION_ID)

The select control in the Event dialog box is supposed to be set to creation
as the default and not allow null values.

--peter

Jesús García Crespo

unread,
May 25, 2009, 1:04:29 PM5/25/09
to Qubit Toolkit Developers
Hi Peter,

On 25 mayo, 18:13, "Peter Van Garderen" <pe...@artefactual.com> wrote:
> The select control in the Event dialog box is supposed to be set to creation
> as the default and not allow null values.

Is this enough? Other archival description templates are exempt of
this problem.

Index: apps/qubit/modules/informationobject/templates/
editIsadSuccess.php
===================================================================
--- apps/qubit/modules/informationobject/templates/editIsadSuccess.php
(revision 2590)
+++ apps/qubit/modules/informationobject/templates/editIsadSuccess.php
(working copy)
@@ -92 +92 @@
- objects_for_select(QubitTerm::getEventTypes(), 'getId',
'__toString', null, array('include_blank' => true))) ?>
+ objects_for_select(QubitTerm::getEventTypes(), 'getId',
'__toString', QubitTerm::CREATION_ID)) ?>


Jesús

Peter Van Garderen

unread,
May 25, 2009, 1:15:02 PM5/25/09
to qubi...@googlegroups.com
No, you're right that's not enough. At one time all information object edit
screens were using the Event dialog box. We recently removed the Event
dialog box from the editISAD screen and I guess we didn't port over the
'default to creation' behaviour. That is an error and should be fixed for
1.0.8

I've opened an issue for it:
http://code.google.com/p/qubit-toolkit/issues/list?thanks=807

--peter

> -----Original Message-----
> From: qubi...@googlegroups.com
> [mailto:qubi...@googlegroups.com] On Behalf Of Jesús García Crespo
> Sent: 25 May 2009 10:04
> To: Qubit Toolkit Developers
Reply all
Reply to author
Forward
0 new messages