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
Posted by Steven Van den Hout in Uncategorized on October 25th, 2010
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
Posted by Steven Van den Hout in drupal on October 14th, 2010
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
Posted by Steven Van den Hout in drupal on October 14th, 2010
Ever wanted to sanitize strings as pathauto does?
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(’èàé ï%’);
}
IE no-wrap problem with slashes!
It seems IE can’t handle long URL’s in small HTML elements. So after a little bit of research I found a simple solution. This may not be the most breaking news but I never heard of it before so…
This is the solution:
/* IE Word wrapper */
word-wrap: break-word;
Hopefully this cal help you.
PHP 6 features
Posted by Joris in Uncategorized on December 30th, 2009
What will PHP6 bring? This article has a little summary of what the future of PHP holds.
Drupal Login Problem in IE
Had some wonderfull Internet Explorer frustrations today and thought i’d share it with you.
When I copied a Drupal site from our testserver to my local machine i found out i couldn’t login to Drupal using Internet Explorer (7).
Firefox worked fine but IE refused 100% of the time. No error messages or warnings, the login block was emptied and you’d return to thesame page.
I did some research and turns out Internet Explorer makes a problem out of underscores in your domainname (whereas Firefox ignores it). Guess what i was using …
I changed my apache vhosts file and windows hosts file by removing the underscore for that particular site, rebooted apache and afterwards my login worked like a charm in IE.
Hope this helps someone .(be aware that I found more problems than this in using IE, sometimes just clearing your cookies would do the tric according to some users. Not in my case though).
PS: This has to be the 5.789.438th time i wished someone would just nuke IE of the planet…
Custom sql queries in Views
I came across this when i was looking for a way to use my own sqly queries in combination with views.
Sometimes you can’t always get the things you want by using views (or you’re too lazy to fiddle around with arguments, relationships, etc.)
The idea is simple :
1) test your own custom query in phpmyadmin for example.
2) create a view and save it. You don’t have to set any filters since the SQL will be overwritten.
2) if you haven’t created your own module yet, create one now and place the following code in it. replace MYMODULE by the name of your own module and VIEW_NAME by the name of the view you’ve just created. Then, change the sql query you see here by your own.
function MYMODULE _views_pre_execute(&$view) {
//drupal_set_message(’—->>>’.$view->name);
if($view->name==”VIEW_NAME”) {
$view->build_info['query']=”SELECT vidnode.nid as nid, vidnode.title as title
FROM node vidnode WHERE vidnode.type=’ptl_remotevideo’
AND vidnode.status <> 0
AND vidnode.nid NOT IN (
SELECT DISTINCT media.field_media_video_ref_nid as video_nid
FROM content_field_media_video_ref media
)”;
}
}
That’s it. I used a node view and it gave me what i wanted. I didn’t have time to check out other settings but i guess it shouldn’t be too hard.
Upgrade ImageMagick to the latest version
A lot of people are looking for an updated installation of ImageMagick instead of those pesky yum packages on Redhat or CentOS. To upgrade to the last version, use these commands :
# uninstall old ImageMagick
yum remove ImageMagick
# get new ImageMagick sources
wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
# untar
tar -zxvf ImageMagick*.tar.gz
cd ImageMagick*
# configure and make
./configure
make
# install
make install
# test ImageMagick (shouldn’t report an error)
convert logo: logo.gif
# fix problem with rmagick not finding ImageMagick libraries
echo /usr/local/lib >> /etc/ld.so.conf.d/ImageMagick.conf
ldconfig
# update rmagick
gem install rmagick
I found this at https://support.railsmachine.com/index.php?pg=kb.page&id=133


Recent Comments