Announcing release of Draft 6.1.6

This release fixes a bug; when creating a new content type, the system would try and retrieve the content type’s columns, even though the content type did not yet exist, and fail because of this. One new feature to this module is the hook_draft() implementation. With the new hook, JavaScript information in forms, such as Ajax-built fields in a content creation page, can now be saved and recalled in a draft.

Bug fixes:
- #435532 Fixed bug when the user creates a new content type the system would not check
if the returned fields were indeed valid since on initial creation nothing would
be valid however the system still wanted to utilize it as an array
New Feature:
- #424592 Added hook_draft() to the module this allows other modules that utilize Ajax in order
to add more elements to the forms to populate the form array based on the information
stored in the drafts table before the form is displayed. This allows for the module to
work correctly with these modules provided someone writes a handler to provide that information

I would like to elaborate on the new feature a little further. The main issue I was receiving from people was Draft’s inability to save and re-load data that was dynamically added to the form, such as information from Flexifield. The hook returns the draft number and all of the pertinent information stored about the draft in the system. It provides the variable “$op” in case we wish to enlarge the scope in future. Currently the $op is 'form elements.' A module should use the hook function to provide an array of the form elements to be injected into the form before the form is rendered. This way, the modules that know they inject data into the form can check via the name they give the data (the array is keyed off the form element names) and can then build the necessary elements. Once the elements are built, Draft module will add them to the form and they will be rendered and populated.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options