Have pieforms to always throw an exception if called after smarty() call

Bug #1792474 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Confirmed
Wishlist
Unassigned

Bug Description

Sometimes when trying to add a form to a page we get an error similar to this:

Pieform element xxxxxxx wants to add headdata to the page, but it's too late. Build your form before generating the page.

It is meaning we need to generate the form before getting to the call

 $smarty = smarty();

It is due to some pieform fields needing to add content to the <head> of a page via the pieform_element_*_get_headdata() function , such as a calendar field, that rely on certain js/css to function correctly.

However, some other pieform fields do not have this problem, and so can cause confusion for developers

It would be better to force all pieform content to be generated before the smarty() call for consistency

Tags: refactoring
Changed in mahara:
importance: Medium → Wishlist
milestone: 19.04.0 → none
tags: added: refactoring
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.