We have moved to Github. Please open tickets there.

Opened 3 years ago

Closed 3 years ago

#1961 closed Defect (fixed)

Reported Content trigger plugin hook appears to contain the wrong information

Reported by: brianchapin Owned by:
Priority: normal Milestone: Elgg 1.7.1
Component: Core Version: 1.7
Severity: minor Keywords:
Cc: brettp Difficulty:

Description

The "add" action in the reportedcontent mod appears to send an empty entity variable when triggering its plugin hook. Code snippet follows:

$entity = new ElggObject;
$entity->subtype = "reported_content";
$entity->owner_guid = $_SESSIONuser?->getGUID();
$entity->title = $title;
$entity->address = $address;
$entity->description = $description;
$entity->access_id = $access;

if ($entity->save()) {

if (!trigger_plugin_hook('reportedcontent:add', $reported->type, array('entity'=>$reported), true)) {

$entity->delete();

I have not tested this, but it seems $entity should be sent along with the trigger call, not $reported.

Change History (2)

comment:1 Changed 3 years ago by cash

  • Type changed from unconfirmed defect to confirmed defect


comment:2 Changed 3 years ago by cash

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [svn:5355]

The plugin hook is now: 'reportedcontent:add', 'system' and it passes the report object as 'report'. Likewise, I standardized the archive and delete plugin hooks to use the same scheme. I made the second parameter system because it is a system level event - it is a report of a page rather than of an entity so there is no real type to send along.

Note: See TracTickets for help on using tickets.