Today for a customer I had to use a special plugin for jQuery that needs a jQuery version equal or major than 1.6.1.
As you know Drupal 7 is shipped with jQuery 1.4.4 and so is not ready for the plugin I need to use, there is a plugin that update jQuery and jQuery UI but where is the fun?
The procedure is pretty quick:
- Download the jQuery version you need from from the official source.
- Place the jQuery version you downloaded in your theme js’s folder (like MYTHEME/js/).
- Create/Modify your theme’s
template.php file as described below.
Now for the
template.php, you need to use the hook_js_alter to replace the native jQuery:
//We define the path of our new jquery core file
//assuming we are using the minified version 1.8.3
$jquery_path = drupal_get_path('theme','MYTHEME') . '/js/jquery-1.8.3.min.js';
//We duplicate the important information from the Drupal one
//..and we update the information that we care about
//Then we remove the Drupal core version
After we clear the cache we will have the new jQuery version.
Keep in mind that changing the jQuery version may create some incompatibility issues with the other Drupal core scripts.
Recently Drupal released the new version (7.16) to fix a security issue that would allow an attacker to reinstall an existing Drupal site with an external database server and then execute custom PHP code, more information available here: http://drupal.org/node/1815912.
There are many way to prevent this instead of updating a Drupal installation (always recommended), probably the quickest is to deny access to the interested file with few lines for the .htaccess file:
deny from all
ErrorDocument 403 "Access denied."
last day I had to update Drupal 7.10 to the most recent at the moment (7.12), I never did something like that so I was like “here we go, 1 work day that will go burned! “, but thanks to the Drupal community I was able to update the installation.
Since isn’t very easy at first (reading UPGRADE.txt was not helpful unfortunately), therefore here a quick list of the steps:
- Put your site into maintenance mode or close accesses from the outside.
- First of all, backup your installation folder (usually a
rsync -av startfolder destinationfolder, or a
cp -a startfolder destinationfolder will do the job just fine)
- Then you have to backup your database (you can do it all in one step using
screen, but I bet that if you are reading this and you are experienced you already know that), depending if you are running MySQL or PostgreSQLthe instructions changes, but I think could be sum up as follows:
mysqldump -uUser -pPassword -hHost dbname > dumpname.sql
pg_dump databasename > dumpname.sql
If you use PostgreSQL you need to remember that the operations have to be done with the correct user. Refer to the documentation for further details.
- After you have done the backups, reach your site root folder and create a folder to hold the new Drupal version, something like
mkdir upgrade, then enter inside it with
- Download the archive with
- Open the archive with
tar -xzvpf drupal-7.12.tar.gz.
- Then enter the newly created directory like we did before,
- At this point we have all that we need, this step is the actual upgrade, we have to move some files in the root directory, assuming you followed this steps, the command you need is the following:
rsync -av CHANGELOG.txt COPYRIGHT.txt cron.php includes index.php INSTALL.mysql.txt INSTALL.pgsql.txt install.php INSTALL.txt LICENSE.txt MAINTAINERS.txt misc modules profiles scripts themes update.php UPGRADE.txt xmlrpc.php ../../
- After you have done that, should be an instant action, open your browser and go to your website URL and add a
/update.php at the end, you should have
- Follow the instruction on-screen to complete the update process on the database, don’t change anything from the dropdowns.
- Once the update is complete you may remove the directory we created to download and extract drupal.
Is not very short but is all you need to do.