
TLF-Text in Flash CS5 bug
I’ve discovered a nasty bug in the Flash CS5 new Text Layout Framework (TLF-Text).
When you type certain characters in a TLF-Text text field, you can get a strange error at compile-time:
Error 1104: Invalid xml name
Since XML is not used in the project we were working on, it didn’t make any sense…
If you use a TLF-Text text field in the Flash IDE, and you type certain characters (in our case “=”) the error starts to appear.
Not sure if this is always the case, but in our case, it triggered the error.
The only workaround I can provide at this time, is to switch the TLF-Text back to Classic-Text.
This off course means loosing the TLF-functionality, but it does stop the error from occurring.
Page redirect after node submit
I wanted to redirect to another page after node submit.
Setting $form['#redirect'] didn’t result in such behaviour.
It’s not a good idea to use the standard form submit handler to redirect to another page since drupal calls a number of hooks when saving a node.
What does work, is setting the $form_state['redirect'] on the submit buttons submit handler.
$form['buttons']['submit']['#submit'][] = ‘my_module_example_form_submit’
Localized terms and views
When you use localized terms (terms have the same tid for all languages, but can be translated in the translate interface)
views has problems translating you terms.
This problem can be resolved by adding the following hook to you custom module
/**
* implementation of hook_views_pre_render
*/
function mymodule_views_pre_render($view) {
if ($view->name == ‘view_name’) {
foreach($view->result as $term) {
$term->term_data_name = tt(’taxonomy:term:’.$term->tid.’:name’, $term->term_data_name);
}
}
}
Sanitize strings
Why not let pathauto do it for you?
if (module_exists(’pathauto’)) {
// add the pathauto.inc file
require_once(drupal_get_path(’module’, ‘pathauto’) . ‘/pathauto.inc’);
$sane_string = pathauto_cleanstring(’èàé ï%’);
}