@baris said in howto: inject hidden data into composer?:
the plugin is responsible for setting any new fields into topic from data.
Ahhh, okay! Now I get it. The plugin needs to alter the postdata in the create and edit hooks, and that data is passed to the action and sockets.
Also in case I missed it your PR was just setting .extraFields but there was no actual way to set those values in the database. That's why I am passing 2 objects to the filter:topic.create filter:post.create hooks. Unless you meant to write to the database in the action hooks, which isn't create because action hooks don't have callbacks to send back errors and execution just keeps going.
Yes, that makes total sense now. I was indeed altering the database in the action hook. Altering the postdata in the create hooks is the right way.