Index: branches/5.2.x/units/links/links_event_handler.php =================================================================== diff -u -N -r14897 -r14914 --- branches/5.2.x/units/links/links_event_handler.php (.../links_event_handler.php) (revision 14897) +++ branches/5.2.x/units/links/links_event_handler.php (.../links_event_handler.php) (revision 14914) @@ -1,6 +1,6 @@ Application->ConfigValue('ReciprocalLinkChecking')) { - return ; + if ( !$this->Application->ConfigValue('ReciprocalLinkChecking') ) { + return; } $object =& $event->getObject( Array('skip_autoload' => true) ); - /* @var $object kDBItem */ + /* @var $object kCatDBItem */ $link_helper =& $this->Application->recallObject('LinkHelper'); /* @var $link_helper LinkHelper */ + $id_field = $this->Application->getUnitOption($event->Prefix, 'IDField'); + $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName'); + // 1. verify all links, that were not verified previously $sql = 'SELECT ' . $id_field . ' FROM ' . $table_name . ' @@ -427,7 +430,7 @@ $object->SetDBField('ReciprocalLinkFound', $link_checked ? LINK_IS_RECIPROCAL : LINK_IS_NOT_RECIPROCAL); $object->Update(); - if ($link_checked) { + if ( $link_checked ) { $object->ApproveChanges(); } else { @@ -437,9 +440,6 @@ } // 2. approve all links, that have succeeded in reciprocal check (during adding/changing on front-end) - $id_field = $this->Application->getUnitOption($event->Prefix, 'IDField'); - $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName'); - $sql = 'SELECT ' . $id_field . ' FROM ' . $table_name . ' WHERE (ReciprocalLinkFound = ' . LINK_IS_RECIPROCAL . ') AND (Status <> ' . STATUS_ACTIVE . ')';