Title: [Plugin: climate change glossary] Javascript and configuration errors
Last modified: August 20, 2016

---

# [Plugin: climate change glossary] Javascript and configuration errors

 *  [Ross t](https://wordpress.org/support/users/rtweedie/)
 * (@rtweedie)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-climate-change-glossary-javascript-and-configuration-errors/)
 * After installing the plugin, I found that a javascript error within the _climate-
   change-glossary/js/script.js_ file was having an affect on other files.
 * The original file was performing an action on a HTML element of ID _#pp\_thesaurus\
   _input\_term_. This only exists on the glossary page, rather than other pages
   on the site. To avoid this error I surrounded the action in an if statement, 
   for example:
 *     ```
       if ($("#pp_thesaurus_input_term").length ) {
       	$("#pp_thesaurus_input_term").clearField().autocomplete(pp_thesaurus_suggest_url, {
       		minChars:		2,
               matchContains:	true,
               cacheLength:	10,
               max:			15,
               scroll:			false
       	}).result(function (event, item) {
       		location.href = item[1];
       	});
       }
       ```
   
 * Our WordPress deployment might be structured differently from most installed,
   but this was causing a problem with the glossary AJAX. On our site we have a 
   current folder and then a deployments folder. The current folder points to the
   latest deployment, making it very quick to switch between versions with very 
   little downtime. The configuration file is linked to a shared folder. Unfortunately
   this does cause a problem when loading the _wp-config.php_ within the plugin.
 * Our folder structure is something like:
    _ current – link to most recent deployment
 * releases – 201201031518/
    – 2011122031518/
 * shared – uploads/
    – wp-config.php
 * To resolve the problem we ensured the _ABSPATH_ global variable was set before
   loading the _wp-config.php_, this ensured the the wp-settings.php and other core
   files could be loaded.
 * This change was added to the _pp-thesaurus-autocomplete.php_ file and consisted
   of the following code:
 *     ```
       if ( !defined('ABSPATH') )
       	define('ABSPATH', $sPath . '/');
   
       require_once($sPath.'/wp-config.php');
       ```
   
 * Would it be possible to make changes to the plugin to help resolve the aforementioned
   issues?
 * Thank-you for creating such a useful plugin.

Viewing 1 replies (of 1 total)

 *  Plugin Author [reegle](https://wordpress.org/support/users/reegle/)
 * (@reegle)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-climate-change-glossary-javascript-and-configuration-errors/#post-2482977)
 * Thank you for the detailed error report. In the new version 1.4 are the bugs 
   fixed.

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: climate change glossary] Javascript and configuration errors’
is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/climate-change-glossary.svg)
 * [climate change glossary](https://wordpress.org/plugins/climate-change-glossary/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/climate-change-glossary/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/climate-change-glossary/)
 * [Active Topics](https://wordpress.org/support/plugin/climate-change-glossary/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/climate-change-glossary/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/climate-change-glossary/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [reegle](https://wordpress.org/support/users/reegle/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-climate-change-glossary-javascript-and-configuration-errors/#post-2482977)
 * Status: not resolved