Skip to content

nbarry10/UNL-CMS

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Requirements:

Get Started:

In this example the web root is /Library/WebServer/Documents and Apache runs as _www - modify the instructions below according to your setup

  • Fork UNL-Information-Services/UNL-CMS and clone your fork into /Library/WebServer/Documents/workspace/UNL-CMS

  • Create a local database (example name: unlcms)

  • From /Library/WebServer/Documents/workspace/UNL-CMS run:

    git submodule init git submodule update

  • Create this file in your home directory with a name like resetunlcms.sh

    echo 'Resetting UNL-CMS... Get ready for action!'

    mysqldump -uYOURUSERNAME -pYOURPASS --add-drop-table --no-data unlcms | grep ^DROP | mysql -uYOURUSERNAME -pYOURPASS unlcms echo 'unlcms database emptied....'

    cd /Library/WebServer/Documents/workspace/UNL-CMS/sites/default rm -rf files rm settings.php mkdir files chown _www files cp default.settings.php settings.php chown _www settings.php

    cd /Library/WebServer/Documents/workspace/UNL-CMS/sites sudo rm -rf localhost.* sudo rm -rf MYDEVMACHINE.unl.edu.* sudo rm -rf unl.edu.* sudo rm sites.php cp example.sites.php sites.php

    echo 'Resetting .htaccess' cd /Library/WebServer/Documents/workspace/UNL-CMS sudo rm .htaccess sudo rm .htaccess-subsite-map.txt cp .htaccess.sample .htaccess cp .htaccess-subsite-map.txt.sample .htaccess-subsite-map.txt sudo chown YOURUSER .htaccess sudo chown YOURUSER .htaccess-subsite-map.txt sed -i "" 's/# RewriteBase /drupal//RewriteBase /workspace/UNL-CMS//' ".htaccess"

    echo 'Done.' echo 'Note: If you want clean urls you need to look at the .htaccess file where it says "Allow public files to be accessed without the sites/<site_dir>/files prefix"';

  • Run that script. (Can also be run whenever you want to reset your dev environment.)

    sudo sh ~/resetunlcms.sh

  • Go to http://localhost/workspace/UNL-CMS and go through the install process

Upgrading Drupal Core

Instructions for upgrading the UNLcms Drupal Core require downloading the latest version of Drupal, comparing it against our local version to create a patch file then creating a pull request to merge the changes in.

diff -ruNa drupal-latest wdn_thm_drupal > drupal_patch.diff
git checkout -b drupal-whateverversion-update master
git apply —check drupal_patch.diff
git apply drupal_patch.diff
git commit -m "Upgrade Drupal Core to 7.XX"
git push origin drupal-whateverversion-update

Once that is complete, open a Pull Request against devel.

Install Issues:

  • Can't create a new site with Drush/UNL Cron if pdo_pgsql is enabled

    If pdo_pgsql is enabled on the php install that is running drush/unl cron then it will fail without modification. Adding the following junk values for pgsql solves the problem at line 414 (D7.10) of install_run_task inside install.core.inc

          $form_state['values']['pgsql']['username'] = 'xxxx'; //add this
          $form_state['values']['pgsql']['database'] = 'xxxx'; //add this
          drupal_form_submit($function, $form_state); //existing code
          $errors = form_get_errors(); //existing code
    

Hacks of Core:

  • includes/bootstrap.inc

    • function drupal_settings_initialize(). UNL change: include a "global" settings file that applies to all sites.

    • function conf_path(). UNL change: Add $default_domains array support for sites.php to list which domains are ok to use with 'unl.edu.*' site_dirs. If no $default_domains array is defined in sites.php, this code will do nothing.

    • Fix so that drupal_serve_page_from_cache() won't override a cached Vary header. http://drupal.org/node/1321086

  • includes/database/database.inc

    Add support for a "db_select_only" config option that prevents drupal from issuing non-select queries to that database. This can be used to allow Drupal to function during a FLUSH TABLES WITH READ LOCK;

  • rewrite.php

    This custom file is used to allow public files to be accessed without the sites/<site_dir>/files prefix.

  • sites/sites.php

    Added support for $default_domains array. See conf_path() in includes/bootstrap.inc

  • sites/example.sites.php

    Added an example of the $default_domains array. Added the stub record needed for creating site aliases.

  • modules/field/modules/text/text.module

Hacks of Contrib modules:

How to Contribute

Development is handled through GitHub

All code changes must be committed via git to a local fork and contributed back to the project via a pull request.

Ideally each developer should have a fork of the project on GitHub where they can push changes.

In your local clone:

  • git pull origin develop
  • git checkout -b topics/whatever-you-work-on (or bugfix/NUM — for bugs)
  • write code and commit
  • git push origin topics/whatever-you-work-on
  • on github open a pull request from your branch to develop
  • have someone else review

Another developer will review your changes and merge in to the develop branch.

About

UNL's Drupal implementation

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 83.1%
  • JavaScript 11.4%
  • CSS 4.8%
  • Shell 0.7%