From 38ea4da2d24e79be62ef660a0c7dc244a702b6fd Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 2 May 2016 00:00:00 +0200 Subject: [PATCH] Fixed batch edit with a new relation. --- ItemRelationsPlugin.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ItemRelationsPlugin.php b/ItemRelationsPlugin.php index ca43fd1..6ace63b 100644 --- a/ItemRelationsPlugin.php +++ b/ItemRelationsPlugin.php @@ -555,6 +555,7 @@ public function hookAdminItemsBatchEditForm() + @@ -562,9 +563,13 @@ public function hookAdminItemsBatchEditForm() formSelect('custom[item_relations_property_id]', null, array(), $formSelectProperties); ?> - - formText('custom[item_relations_item_relation_object_item_id]', - null, array('size' => 6)); + formText('custom[item_relations_item_relation_object_item_id]', + null, array('size' => 4, 'placeholder' => __('Item ID'))); + ?> + formText('custom[item_relations_item_relation_relation_comment]', + null, array('size' => 12)); ?> @@ -793,7 +798,7 @@ public static function insertItemRelation($subjectItem, $propertyId, $objectItem $itemRelation->subject_item_id = $subjectItem->id; $itemRelation->property_id = $propertyId; $itemRelation->object_item_id = $objectItem->id; - $itemRelation->relation_comment = ( $relationComment ? $relationComment : ""); + $itemRelation->relation_comment = strlen($relationComment)? $relationComment : ''; $itemRelation->save(); return true;