I'm working on a plugin that launches a dialog from the edit/new entry page. It lets a user select a language and upload a file to be associated with that language. This is all working fine via a custom object I created and my extension of the upload_file subroutines.
What I'm stuck on is how to best associate those assets with the entry that's being edited or created. I can add another field to the custom object to contain an entry id that the assets should be associated with. However, I've tried accessing properties about the $entry from within the plugin:
my $entry = shift;
return $entry->id;
I get the following error:
"Can't call method "id" on an undefined value"
I believe that the entry object isn't available to this plugin for some reason. There isn't any difference whether it's a new entry or entry that's already been saved, and therefore has a row in the database.
Any pointers on where to go next? (And yes, I've read through the documentation and code extensively at this point.)
--Amy
