includes/form.inc
and includes/ajax.inc
files is accepted into Drupal-7.37 core, you may also experiment with the OOE = Object Oriented Examples = One Of Each tutorial module easily using: Download: OOE bundle with adapted Drupal-7.36 and installation instructions.
Because the OOE = Object Oriented Examples = One Of Each module uses object-oriented form controllers, some harmless, minor modifications to the Drupal7 core files includes/form.inc
and includes/ajax.inc
are required to support callback on static object-oriented methods (since Drupal7 assumes that only non-OO functions will be used as callbacks). These modifications are explained in detail at: OOE: special tweaks to Drupal7 core's form.inc required to support object-oriented form controllers.
includes/form.inc
and includes/ajax.inc
, making it easier for you experiment with the OOE = Object Oriented Examples = One Of Each tutorial module.
includes/form.inc
and includes/ajax.inc
has been made available in the hope it will be adopted into Drupal-7.37 core.
Please add your support by helping with community testing at https://www.drupal.org/node/2166371 and https://www.drupal.org/node/2165895 !
To install and run the OOE = Object Oriented Examples = One Of Each tutorial module using this patch and Git:
1. From your web root (on Mac this is usually /Library/WebServer/Documents
) clone the latest development version of Drupal7. It is recommended that you then rename the top-level drupal
folder so that it's clear it is being modified for the one module ooe
. Depending on your permissions, you may also have to perform this as sudo
:
$ cd /Library/WebServer/Documents $ git clone --branch 7.x http://git.drupal.org/project/drupal.git $ mv drupal drupal-7.x-ooe $ cd drupal-7.x-ooe
2. Check that you have a Git branch:
$ git status # On branch 7.x nothing to commit, working directory clean
3. Download the patch file from https://www.drupal.org/files/issues/drupal-oo_static_method_support_for_... and (optionally) copy it into the root of the Drupal instance you'll be patching. If you have wget
(or curl
) this is easy:
$ cd /Library/WebServer/Documents/drupal-7.x-ooe $ wget https://www.drupal.org/files/issues/drupal-oo_static_method_support_for_form_execute_handlers_and_drupal_retrieve_form_and_ajax_form_callback-2166371-2165895_0.patch
4. Apply the patch with Git:
$ git apply -v drupal-oo_static_method_support_for_form_execute_handlers_and_drupal_retrieve_form_and_ajax_form_callback-2166371-2165895.patch Checking patch includes/ajax.inc... Checking patch includes/form.inc... Applied patch includes/ajax.inc cleanly. Applied patch includes/form.inc cleanly.
5. Perform the usual Drupal installation, including creation of a database, assignment of database user permissions, and copying /sites/default/default-settings.php
to /sites/default/settings.php
and including your database connection, as described under the main Drupal.org Installation Guide.
6. You should be able to then perform: http://localhost/drupal-7.x-ooe/install.php
.
7. You should be able to load your home page as: http://localhost/drupal-7.x-ooe.
8. Create a single Basic Page (/node/add/page) or Article (/node/add/article) and make sure it is Promoted to front page under the publishing options. You will need at least a few content pages for the OOE versions of the Current Posts demos to work nicely, but one is enough to get you started.
8. Download the OOE module (which is still in the sandbox). You may use Git clone, but make sure to specify an explicit target folder ooe
, otherwise it will create a folder named after the sandbox project number 2120905
.
$ cd /Library/WebServer/Documents/drupal-7.x-ooe/sites/modules/all $ git clone --branch 7.x-1.x git://git.drupal.org/sandbox/webel/2120905.git ooe
Alternatively, you can download a snapshot of OOE as a compressed TGZ archive using the Drupal Git repository viewer, then unpack (and rename to ooe
into /sites/all/modules
.
Please note that this also includes the UML diagram image files for the unique UML-friendly OOE project (so the download will take a little longer than some other modules) !
9. Using the /admin/modules/list
UI or Drush, enable the OOE module:
/Library/WebServer/Documents/drupal-7.x-ooe $ drush -y en ooe
This will also download and enable the dependencies X Autoload and Page Controller.
10. Then reload your home page http://localhost/drupal-7.x-ooe
, which should now show some additional sidebar blocks for the OOE demonstration. If the OOE blocks don't appear immediately, check under /admin/blocks/list
.
11. Finally, visit the OOE demonstrations page: http://localhost/drupal-7.x-ooe/ooe
.