It seems that whenever I replace the input field using an ElementInput filter, any data that gets submitted with the replacement either gets lost or is truncated to its first letter. This is seriously impeding the progress of an item builder plugin I’m working on that relies on custom element inputs.
Here is a short unrelated sample demonstrating the issue (actually the exact same one from the Manual):
class DummyPlugin extends Omeka_plugin_AbstractPlugin {
protected $_filters = array(
'shortenSubjectField' => array('ElementInput', 'Item', 'Dublin Core', 'Title'),
);
public function shortenSubjectField($components, $args) {
$components['input'] = get_view()->formText($args['input_name_stem'], $args['value']);
return $components;
}
}
Try renaming any item with the plugin activated (the “Title” DC field becomes a single line when it is on), it would lose its title entirely. If you add $components[‘html_checkbox’] = false;, you would get the first character only.
I am currently working with the stable 2.4 branch for Omeka classic, with every other plugin turned off. Can someone please look into where this behaviour comes from?