Ah. The editedby field is empty if a new resource is created, but never edited.
Try this:
$editor = $resource->get('editedby');
if (empty($editor)) {
$editor = $resource->get('createdby');
}
or you could just go with createdby to begin with:
$editor = $resource->get('createdby');
-
☆ A M B ☆
- 24,524 Posts
I started playing around with the Stagecoach extra a while ago, and it seems pretty interesting.
http://bobsguides.com/stagecoach-tutorial.html
-
☆ A M B ☆
- 24,524 Posts
Maybe Bob can be coaxed into adding features
Quote from: dubbs at Jun 26, 2013, 06:38 AM
The only short coming of this implementation comes when an editor edits a live resource... when they save, the amends go directly live... the Publisher does receive an email notifying them of the update - but the editor's changes go live upon saving the resource... is there a way to prevent this? The implementation works perfect for NEW resources - but not updating existing ones...
On the properties tab when editing the ResourceWatcher plugin, if you set these properties to true, it should work on both new and updated resources:
&resourcewatcher.new_active
&resourcewatcher.upd_active
-
☆ A M B ☆
- 24,524 Posts
Of course a plugin can be used to send email when a resource is created or edited.