drupal

I've tracked down a source of the bug which breaks jquery (1.2.6) in FireFox (Chrome is fine) where you'll see a debug message of "z.indexOf is not a function". If you're running a minified jquery then the line number won't help locate the bug, but in this case it was around line 1715:

type == "^=" && z && !z.indexOf(m[5])

This code is triggered by jquery attribute filters like ^= (starts with) or *= or ~= and in this case I found that if z had been 0 then the code which checks "&& z" would short circuit and not try to reference indexOf of z.

Looking deeper, I found that z == -1 (not a string) and that this was because I was filtering on the 'value' attribute, and that in FireFox, the 'li' node was being given some value of -1. You can check this by running "$('li')" and checking out the returned values. In Chrome, there is no value. This difference causes a bug in FireFox.

One workaround is to use only use attribute filters when using selectors that select for specific tags which exclude 'li', at least for filtering on 'value'. For example, use 'input[value^=whatever]' instead of just '[value^=whatever]'.

PHP 5.2 has support for showing the percentage uploaded for a file upload in progress. If you're not running Apache as your web server,

Drupal's FileField module automatically detects for and uses upload progress support on the server end. This can either be APC (Alternative PHP Cache) with rfc1867 support or with the uploadprogress PECL extension. In Drupal, the upload progress bar looks like this:

You can check to see if you already have support by going to admin/reports/status.

If the report shows that your server has support yet FileField CCK fields aren't updating the upload progress bar then your server has a problem.

Read the rest of this article...

Getting Drupal to stream video using PHP and the FlashVideo module to manage video uploads is not easy. It involves 5 distinct pieces of software, which means 5 places where things could go wrong with little error logging.

Here's what you need:
1. FlashVideo http://drupal.org/project/flashvideo
2. ffmpeg
3. flvtool2
4. xmoov-php
5. JW Player

Read the rest of this article...

Drupal Administration Menu Missing Links

Submitted by tomo on December 7, 2010 - 5:30pm

Working on a Drupal site that's already half-way started, I noticed that after installing the admin_menu module many links I expected were missing, such as the refresh cache links and several content types under the Content Types menu.

First, I tried clearing out all caches manually via the Performance page.

Next, I tried truncating all cache tables in case cache_menu or another table was corrupted.

Still no go, so I tried disabling, uninstalling, and reinstalling the admin_menu module which should rebuild the admin_menu links in the menu router.

In the end it turned out to be a Wampserver problem as it (as well as Xampp) use PHP 5.3, which Drupal has a lot of problems with. PHP 5.3 has a change from earlier versions in that function declarations like:

function admin_menu_admin_menu(&$deleted)

no longer work. Normally, you'd see that in your error messages.

The solution is to remove the & before $deleted on line 107 in admin_menu.inc in the admin_menu module. This will also make the related PHP warnings go away.

Running 5.2 and 5.3 on one computer using XAMPP (on OSX) is easy by following these instructions: https://gist.github.com/1012774

Theme developer saving to wrong temp directory

Submitted by tomo on September 7, 2010 - 1:36am

After importing a database for a Drupal site from a different server, you may see errors such as:

warning: file_put_contents(/devel_themer_19527646904c852428ef200) [function.file-put-contents]: failed to open stream: Permission denied in /home/tomo/xxx/sites/all/modules/3rdparty/devel_themer/devel_themer.module on line 638.

And if you try to select an element:

Ajax variables file not found.

What's going on here is the files aren't being written to the temp directory which is a Drupal variable stored in the database.  Delete the row from the variables table where name is file_directory_temp and then Drupal will automatically set the variable to the correct directory.

delete from variables where name='file_directory_temp';
or
delete from variable where name='file_directory_temp';

Read the rest of this article...
Syndicate content
© 2010-2014 Saigonist.