I'm administering a bunch of small sites on different locations and also playing in my sandbox with the 4.7 beta. It would really help me avoid getting lost if I could see the Drupal version somewhere. On the admin page at least and also in the html of the generated page.

I've had a good wander through the source, and these forums, and I cannot see any easy way of doing this. In fact there doesn't seem to be any variables/constants/functions that return the current Drupal version details.

If I am missing how to do this could someone point out how, please? Or is there some reason why the Drupal version number isn't available?

Thanks

Lee

Comments

dublin drupaller’s picture

If you open up the changelog.txt file in your Drupal root folder you can tell which version is being used. Although, it's probably a good idea to have something in the ADMINISTER -> SETTINGS page maybe that says "you are using Drupal version x.x".

Especially if you are working on various Drupal sites and forget sometimes which is which.

Site Admins putting something subtle in the footer maybe a temp workaround...

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

thehazard’s picture

[root@warship drupal47]# grep -r "4.7" * | grep VERSION
modules/drupal.module:define(VERSION, '4.7.0');
[root@warship drupal47]#

enable the drupal module, and try that:

echo "<h1>hello, my drupal is: " . VERSION . "</h1>";

and you'll be all set.

--
got pwned today ?
http://www.gotpwned.com/

LeeMcL’s picture

Thanks for the information that the version string is available in 4.7.0-beta3. Sadly it is not available in any earlier versions. Well I guess thats why text editors exist!

Somewhat annoying that the version string in 4.7.0-beta3 doesnt mention it is beta3. Shame too that you have to enable another module to get it. I guess I am just surprised that it isn't more readily available.

Thanks

Lee

thehazard’s picture

that the drupal version should be more explicit (but that's not a concern, since the core is now coming with that). What do you need, exactly ? You may try to test the existance or abstence of a drupal core function to determine the version (not the best way, but works).

--
got pwned today ?
http://www.gotpwned.com/

LeeMcL’s picture

I wanted version info' mainly to help remind me which Drupal I was now using. I have a test 4.6.4 and another test site using 4.7.0-beta3 (and I just remembered I have another running CVS!). It would be helpful to just see a version number. Clearly this isn't necessary, in particular between 4.6 and 4.7 there are major differences in some of the admin menu bits, but I find it a useful reminder.

I also wanted to share some code between the versions and it would make it very clear what was going on if the code checked the Drupal version details before using features that differ between the releases. Yes, you can achieve the same effect by looking at which functions are defined (unless you are using the legacy.inc module!). But I think version checking is clearer.

Lee

sepeck’s picture

To additional information.
http://drupal.org/node/27362

-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

ica’s picture

Funny that I have made a point/request to the core for Administrators
not just the core version but modules as well

http://drupal.org/node/44611

AmrMostafa’s picture

  1. Open any core file that gets updated much by core developers, in my case I chose modules/system.module
    First line will look like:
    // $Id: system.module,v 1.204.2.1 2005/04/12 19:00:39 dries Exp $
    Now notice the revision here, 1.204.2.1 and write it down.
  2. Go to http://cvs.drupal.org and browse to the /drupal/modules/system.module file, that will open lots of entries representing the revision history for that file, scroll down or use find feature in your browser to find the exact entry for the revision number that we took in the above steps (1.204.2.1 in my case).
  3. In this entry you will find a line that says CVS Tags: DRUPAL-XXX, these XXX will tell you what version your drupal is :-).

That helped me because in the drupal installation I was dealing with, there was no CHANGELOG file.

webmestre@coll-vallcarca.net’s picture

Tnaks to this clue, I knew what version we were using on a site.

thanks.

ahijado’s picture

The version number for 4.6.x versions can be found under the drupal root/fantversion.php file

ahijado

heine’s picture

Only when installed and upgraded with fantastico.

--
The Manual | Troubleshooting FAQ | Tips for posting | Make Backups! | Consider creating a Test site.