From The Blog

Drupal: Custom node edit menu callback, image upload widget disappears when change file

21 March 2016, in Drupal

I had an issue with a custom node edit menu callback, that when the remove button is clicked to replace the current uploaded image, the whole widget disappears.

I already loaded file as follows:

module_load_include('inc', 'node', 'node.pages');

BUT, apparently you should add these line to the menu item array:

'file path' => drupal_get_path('module', 'node'),
'file' => '',

It is not enough to just add module_load_include('inc', 'node', 'node.pages'); before printing the form.

Post a Comment