Last updated March 7, 2009. Created by dww on December 30, 2006.
Edited by esmerel, webchick. Log in to edit this page.
In addition to the steps mentioned in the Converting 4.7.x modules to 4.7.4 page, there has been another subtle change to the 4.7.x API in the 4.7.5 release that might affect modules (or themes). The change came as result of fixing a critical bug in the way that the Forms API renders the #prefix and #suffix values in form arrays. Unfortunately, this change might require modifications to the code of a certain modules, something we try to avoid in the middle of a stable series as much as possible.
In 4.7.x, if you put something in $form['#prefix'] it was included inside the <form> HTML that was rendered for your form. So, for example, if you used this in a node-type form:
$form['#prefix'] = '<div class="your-custom-node-type">
the resulting HTML gave you the <div class="node-form"> before your custom div from the #prefix. Now, the #prefix is always rendered outside the <form>. This is essential behavior for correctness, but some modules might be relying on the old behavior. For example, this change can impact any custom CSS your module is relying on. For example, if you used to do this:
4.7.x:
.node-form .project ... {
/* something interesting for project nodes */
}you now need to change the order of the classes in your .css file, like this:
4.7.5:
.project .node-form ... {
/* something interesting for project nodes */
}Since the <div class="node-form"> is always included inside the <form> tag, your prefix now comes first.
You can also create a CSS rule to apply to both:
.node-form .project ... ,
.project .node-form ... {
/* something interesting for project nodes */
}