No barcode gets generated at Preview, therefore it breaks a lot of things, such as print module.

Comments

edxxu’s picture

Project: Barcode » Mollom
Version: 7.x-2.x-dev » 7.x-1.1
Assigned: edxxu » Unassigned
Priority: Critical » Major

I disabled Mollom module, so that Barcode module can generate barcode properly in node preview, so i think there is something wrong with Mollom module.

sun’s picture

Project: Mollom » Barcode
Version: 7.x-1.1 » 7.x-2.x-dev

Mollom has to enable form caching for a form, which means that the form constructor is only invoked once to build the initial $form structure.

All modules need to be prepared for cached forms in D7, because #ajax enables form caching, too.

In case you have any dynamic information or output in the initial $form structure, then you need to move that code into a callback function that is invoked later in the form processing, and most importantly, invoked for both cached and uncached forms.

Typically, you want to use #pre_render for pure output, or #process or #after_build if you need to change the form structure or access/read other sections in the form to generate the information.