Browse Source

Merge branch '7.x-3.x' into 1040-tv3-gff3_performance

Stephen Ficklin 4 years ago
parent
commit
c8f1ead03b
100 changed files with 768 additions and 614 deletions
  1. 58 60
      README.md
  2. 17 3
      docs/contributing/pull_requests.rst
  3. 2 2
      docs/dev_guide/chado.rst
  4. 3 3
      docs/dev_guide/custom_data_loader.rst
  5. 2 2
      docs/dev_guide/custom_field.rst
  6. 1 1
      docs/dev_guide/custom_field/ajax_custom_formatter.rst
  7. 16 16
      docs/dev_guide/custom_field/create_instance.rst
  8. 6 6
      docs/dev_guide/custom_field/custom_formatter.rst
  9. 2 2
      docs/dev_guide/custom_field/custom_widget.rst
  10. 10 10
      docs/dev_guide/custom_field/manual_field_creation.rst
  11. 2 2
      docs/dev_guide/custom_web_services.rst
  12. 1 1
      docs/dev_guide/data_structures.rst
  13. 1 1
      docs/dev_guide/exporting_field_settings.rst
  14. 1 1
      docs/user_guide/install_tripal/custom_theme.rst
  15. 1 1
      docs/user_guide/install_tripal/server_setup.rst
  16. 1 1
      legacy/tripal_analysis/tripal_analysis.views_default.inc
  17. 1 1
      legacy/tripal_contact/tripal_contact.views_default.inc
  18. 1 1
      legacy/tripal_core/api/tripal_core.chado_nodes.api.inc
  19. 1 1
      legacy/tripal_feature/theme/templates/tripal_feature_alignments.tpl.php
  20. 1 1
      legacy/tripal_featuremap/tripal_featuremap.views_default.inc
  21. 1 1
      legacy/tripal_genetic/tripal_genetic.views_default.inc
  22. 1 1
      legacy/tripal_library/tripal_library.views_default.inc
  23. 1 1
      legacy/tripal_organism/includes/tripal_organism.chado_node.inc
  24. 1 1
      legacy/tripal_phenotype/tripal_phenotype.views_default.inc
  25. 129 110
      legacy/tripal_phylogeny/theme/js/tripal_phylogeny.js
  26. 1 1
      legacy/tripal_project/tripal_project.views_default.inc
  27. 1 1
      legacy/tripal_pub/includes/tripal_pub.admin.inc
  28. 1 1
      legacy/tripal_pub/includes/tripal_pub.chado_node.inc
  29. 1 1
      legacy/tripal_stock/tripal_stock.module
  30. 1 1
      legacy/tripal_stock/tripal_stock.views_default.inc
  31. 4 4
      tripal/includes/TripalBundleController.inc
  32. 2 2
      tripal/includes/TripalEntityCollection.inc
  33. 47 3
      tripal/includes/TripalEntityController.inc
  34. 90 18
      tripal/includes/TripalEntityUIController.inc
  35. 5 5
      tripal/includes/TripalFields/TripalField.inc
  36. 1 1
      tripal/includes/TripalFields/TripalFieldFormatter.inc
  37. 2 2
      tripal/includes/TripalFields/TripalFieldWidget.inc
  38. 1 1
      tripal/includes/TripalFields/content_type/content_type.inc
  39. 4 4
      tripal/includes/TripalFields/rdfs__type/rdfs__type.inc
  40. 1 1
      tripal/includes/TripalFields/rdfs__type/rdfs__type_formatter.inc
  41. 1 1
      tripal/includes/TripalFields/rdfs__type/rdfs__type_widget.inc
  42. 3 3
      tripal/includes/TripalImporter.inc
  43. 3 1
      tripal/includes/tripal.entity.inc
  44. 1 1
      tripal/includes/tripal.field_storage.inc
  45. 6 1
      tripal/tripal.module
  46. 4 4
      tripal/tripal_views_query.inc
  47. 1 1
      tripal/views_handlers/tripal_views_handler_filter_select_string.inc
  48. 1 1
      tripal_bulk_loader/api/tripal_bulk_loader.api.templates.inc
  49. 2 2
      tripal_chado/api/modules/tripal_chado.analysis.api.inc
  50. 1 1
      tripal_chado/api/modules/tripal_chado.contact.api.inc
  51. 2 2
      tripal_chado/api/modules/tripal_chado.cv.api.inc
  52. 1 1
      tripal_chado/api/modules/tripal_chado.db.api.inc
  53. 5 5
      tripal_chado/api/modules/tripal_chado.feature.api.inc
  54. 6 6
      tripal_chado/api/modules/tripal_chado.module.DEPRECATED.api.inc
  55. 2 2
      tripal_chado/api/modules/tripal_chado.organism.api.inc
  56. 5 5
      tripal_chado/api/modules/tripal_chado.phylotree.api.inc
  57. 2 2
      tripal_chado/api/modules/tripal_chado.project.api.inc
  58. 3 3
      tripal_chado/api/modules/tripal_chado.pub.api.inc
  59. 2 2
      tripal_chado/api/modules/tripal_chado.stock.api.inc
  60. 1 1
      tripal_chado/api/tripal_chado.variables.api.inc
  61. 210 210
      tripal_chado/chado_schema/default_schema-1.2-1.3-diff.sql
  62. 4 4
      tripal_chado/includes/TripalFields/ChadoField.inc
  63. 4 4
      tripal_chado/includes/TripalFields/chado_linker__contact/chado_linker__contact.inc
  64. 1 1
      tripal_chado/includes/TripalFields/chado_linker__contact/chado_linker__contact_formatter.inc
  65. 1 1
      tripal_chado/includes/TripalFields/chado_linker__contact/chado_linker__contact_widget.inc
  66. 4 4
      tripal_chado/includes/TripalFields/chado_linker__prop/chado_linker__prop.inc
  67. 1 1
      tripal_chado/includes/TripalFields/chado_linker__prop/chado_linker__prop_formatter.inc
  68. 1 1
      tripal_chado/includes/TripalFields/chado_linker__prop/chado_linker__prop_widget.inc
  69. 4 4
      tripal_chado/includes/TripalFields/data__accession/data__accession.inc
  70. 1 1
      tripal_chado/includes/TripalFields/data__accession/data__accession_formatter.inc
  71. 1 1
      tripal_chado/includes/TripalFields/data__accession/data__accession_widget.inc
  72. 6 6
      tripal_chado/includes/TripalFields/data__protein_sequence/data__protein_sequence.inc
  73. 1 1
      tripal_chado/includes/TripalFields/data__protein_sequence/data__protein_sequence_formatter.inc
  74. 1 1
      tripal_chado/includes/TripalFields/data__protein_sequence/data__protein_sequence_widget.inc
  75. 4 4
      tripal_chado/includes/TripalFields/data__sequence/data__sequence.inc
  76. 1 1
      tripal_chado/includes/TripalFields/data__sequence/data__sequence_formatter.inc
  77. 1 1
      tripal_chado/includes/TripalFields/data__sequence/data__sequence_widget.inc
  78. 4 4
      tripal_chado/includes/TripalFields/data__sequence_checksum/data__sequence_checksum.inc
  79. 1 1
      tripal_chado/includes/TripalFields/data__sequence_checksum/data__sequence_checksum_formatter.inc
  80. 1 1
      tripal_chado/includes/TripalFields/data__sequence_checksum/data__sequence_checksum_widget.inc
  81. 4 4
      tripal_chado/includes/TripalFields/data__sequence_coordinates/data__sequence_coordinates.inc
  82. 1 1
      tripal_chado/includes/TripalFields/data__sequence_coordinates/data__sequence_coordinates_formatter.inc
  83. 1 1
      tripal_chado/includes/TripalFields/data__sequence_coordinates/data__sequence_coordinates_widget.inc
  84. 1 1
      tripal_chado/includes/TripalFields/data__sequence_coordinates_table/data__sequence_coordinates_table_formatter.inc
  85. 4 4
      tripal_chado/includes/TripalFields/data__sequence_length/data__sequence_length.inc
  86. 1 1
      tripal_chado/includes/TripalFields/data__sequence_length/data__sequence_length_formatter.inc
  87. 1 1
      tripal_chado/includes/TripalFields/data__sequence_length/data__sequence_length_widget.inc
  88. 4 4
      tripal_chado/includes/TripalFields/efo__array_design/efo__array_design.inc
  89. 1 1
      tripal_chado/includes/TripalFields/efo__array_design/efo__array_design_formatter.inc
  90. 1 1
      tripal_chado/includes/TripalFields/efo__array_design/efo__array_design_widget.inc
  91. 4 4
      tripal_chado/includes/TripalFields/go__gene_expression/go__gene_expression.inc
  92. 1 1
      tripal_chado/includes/TripalFields/go__gene_expression/go__gene_expression_formatter.inc
  93. 1 1
      tripal_chado/includes/TripalFields/go__gene_expression/go__gene_expression_widget.inc
  94. 4 4
      tripal_chado/includes/TripalFields/local__contact/local__contact.inc
  95. 1 1
      tripal_chado/includes/TripalFields/local__contact/local__contact_formatter.inc
  96. 1 1
      tripal_chado/includes/TripalFields/local__contact/local__contact_widget.inc
  97. 4 4
      tripal_chado/includes/TripalFields/local__source_data/local__source_data.inc
  98. 1 1
      tripal_chado/includes/TripalFields/local__source_data/local__source_data_formatter.inc
  99. 1 1
      tripal_chado/includes/TripalFields/local__source_data/local__source_data_widget.inc
  100. 4 4
      tripal_chado/includes/TripalFields/obi__organism/obi__organism.inc

+ 58 - 60
README.md

@@ -7,76 +7,74 @@
 
 ![alt tag](https://raw.githubusercontent.com/tripal/tripal/7.x-3.x/tripal/theme/images/tripal_logo.png)
 
-Tripal is a toolkit for constructing online biological (genetics, genomics, breeding, etc.) community databases, and Tripal is a member of the [GMOD](http://www.gmod.org) family of tools. **Tripal v3** provides integration with the [GMOD Chado database](http://gmod.org/wiki/Chado_-_Getting_Started) by default.
-
-Genetics, genomics, breeding, and other biological data are increasingly complicated and time-consuming to publish online for others to search, browse and make discoveries with. Tripal provides a framework to reduce the complexity of creating such a site, and provides access to a community of similar groups that share community-standards. The users of Tripal are encouraged to interact to address questions and learn the best practices for sharing, storing, and visualizing complex biological data.
-
-The primary goals of Tripal are to:
-1.	Provide a framework for creating sites that allow display, search, and visualization of biological data, including genetics, genomics, and breeding data;
-2.	Use community-derived standards and ontologies to facilitate continuity between sites and foster collaboration and sharing;
-3.	Provide an out-of-the-box setup for a genomics site to put new genome assemblies and annotations online; and
-4.	Provide Application Programming Interfaces (APIs) to support customized displays, look-and-feel, and new functionality.
-
-
-# Features
-The following major features
-are available in Tripal v3.
-
-* Tripal v3's design is centered around controlled vocabularies and ontologies. 
-  This allows for greater integration with the semantic web and will help
-  support data exchange between Tripal sites.
-* RESTful web services.  Tripal v3 introduces RESTful web services for Tripal.
-  The resources provided by these web services uses JSON-LD and WC3 Hydra 
-  vocabulary to deliver content. 
-* Tripal v3 introduces new content pages. In older versions of Tripal all 
-  content was provided via Drupal "nodes".  Now content is delivered using
-  new content types (e.g. gene, genetic_marker, organism, germplasm, etc.)
-  and the site admin controls which content types are available on the site. 
-* Chado support:
-  * Tripal v3 represents a major redesign from previous versions.  Previously,
-    Chado was the only storage backend supported. Tripal v3 provides by default
-    support for Chado, but also sports a new design that affords integration of
-    other storage backends (including noSQL options).  
-  * A Chado v1.2 or v1.3 installer
-  * Data loaders for ontologies (controlled vocabularies), GFF files, and 
-    FASTA files, publications (from PubMed and AGIRCOLA). 
-  * Generic Bulk Data Loader Modules allows for creation of custom loaders 
-    without programming (requires an understanding of Chado). 
-  * Supports creation of materialized views for faster data queries.
+Welcome to the home of Tripal Development! If you are thinking to yourself "What is Tripal?", head over to [our website, Tripal.info](http://tripal.info/).
 
+# Current Status
 
-# Required Dependencies
-* Drupal: 
-  * Drupal 7.x
-  * Drupal core modules: Search, Path and PHP modules.
-  * Drupal contributed modules: 
-    * [Views](http://drupal.org/project/views)
-    * [Entity API](http://drupal.org/project/entity)
-* PostgreSQL
-* PHP 5.5+
-* UNIX/Linux
+ - Recommended Version: ![GitHub release (latest by date)](https://img.shields.io/github/v/release/tripal/tripal?color=brightgreen)
+ - Development:
+    - [![Tripal 3](https://img.shields.io/badge/dev-7.x--3.x-yellow)](https://github.com/tripal/tripal): Focus is on bug fixes
+    - [![Tripal 4](https://img.shields.io/badge/dev-7.x--4.x-yellow)](https://github.com/tripal/t4d8): Full upgrade to Drupal 8/9 (development in [T4D8 Repository](https://github.com/tripal/t4d8)).
+ - Tripal ![Tripal 1.x](https://img.shields.io/badge/unsupported-7.x--1.x-red) and ![Tripal 2.x](https://img.shields.io/badge/unsupported-7.x--2.x-red) are no longer supported by the Project Management Committee, although we will accept community submitted fixes for Tripal 2.x.
+
+ # Resources
+
+  - For information on **how to use Tripal** through the Administrative Interface: [Tripal Users Guide](https://tripal.readthedocs.io/en/latest/user_guide.html)
+  - For help **extending Tripal** or understanding how it works: [Tripal Developers Guide](https://tripal.readthedocs.io/en/latest/dev_guide.html)
+  - To check if another group already developed the functionality you need: [Listing of **Available Extension Modules**](https://tripal.readthedocs.io/en/latest/extensions.html)
+  - Tripal is developed by a world-wide community! See the [description of our **Governance Structure**](https://tripal.readthedocs.io/en/latest/contributing/governance.html)
+  - If you are the head of a research group looking to fund Tripal Development: [Guide to **Funding Proposal** Development](https://tripal.readthedocs.io/en/latest/contributing/funding.html)
+  - For how to **install Tripal**, follow the instructions in the online Tripal User's Guide for [Tripal v2](https://tripal.info/tutorials/v2.x/installation) or [Tripal v3](https://tripal.readthedocs.io/en/latest/user_guide.html).
+  - For how to **upgrade from Tripal 2 to Tripal 3**, follow the [Upgrade Instructions](https://tripal.readthedocs.io/en/latest/user_guide/install_tripal/upgrade_from_tripal2.html) in the Tripal v3 User's Guide.
+
+# Contribution
 
+Looking to contribute? That's Amazing -Welcome!!! Here's a quick run-down to get you started:
 
-# Installation
-Please follow the instructions in the online Tripal User's Guide for [Tripal v2](https://tripal.info/tutorials/v2.x/installation) or [Tripal v3](https://tripal.readthedocs.io/en/latest/user_guide.html).
+ - We welcome all contributions!
+ - This github issue queue is open to: bug reports, usability concerns, performance issues, site administration or development questions, data storage discussions, etc.
+ - We ask that questions/concerns/bugs with **extension modules** be addressed in their respective repositories (including those under the Tripal organization).
+ - For **feature request**, please open an issue with detailed use cases and description. We would love to help you design a generic solution for the community whether it belongs in Tripal Core or an Extension module! Please wait to submit a PR until the Project Management Committee (PMC) indicates it is generally applicable and should be included in Core.
+ - For **potential bugs or concerns**, please open an issue being as descriptive as possible. Screenshots and steps to reproduce will help us, help you! If you know how to fix the issue, feel free to submit a pull request (PR) linked to the issue!
+ - For **documentation** contributions, click the "Edit on Github" link at the top of the page you want to improve! [Instructions for our flavour of ReadtheDocs can be found on ReadtheDocs](https://tripal.readthedocs.io/en/latest/contributing/documentation.html).
+ - See our quickstart if you need help on how to submit a PR: [ReadtheDocs, how to create a PR](https://tripal.readthedocs.io/en/latest/contributing/pull_requests.html#how-to-create-a-pr).
+ - Click on issues > New Issue for helpful issue templates.
+ - For Tripal 4 (Drupal 8/9), see the [T4D8 repository](https://github.com/tripal/t4d8).
 
+For more detailed guidelines see our [full Contribution Documentation](https://tripal.readthedocs.io/en/latest/contributing/pull_requests.html)!
 
-# Upgrade from Tripal v2.x to v3.x
-Please follow the [Upgrade Instructions](https://tripal.readthedocs.io/en/latest/user_guide/install_tripal/upgrade_from_tripal2.html) in the Tripal v3 User's Guide
 
+# Github Communication Tips
 
-# Customization
-Tripal can be used “as is” but also allows for complete customization.
-PHP-based template files are provided for all data types to allow for 
-precise customizations as required by the community. A well-developed 
-Tripal API provides a uniform set of variables and functions for 
-accessing any and all data within the Chado database. See the Tripal 3.x
-Developer's Handbook for additional details.
+ - Don’t be afraid to mention people (@username) who are knowledgeable on the topic or invested. We are academics and overcommitted, it’s too easy for issues to go unanswered: don’t give up on us!
+ - Likewise, don’t be shy about bumping an issue if no one responds after a few days. Balancing responsibilities is hard.
+ - Want to get more involved? Issues marked with “Good beginner issue” are a good place to start if you want to try your hand at submitting a PR.
+ - Everyone is encouraged/welcome to comment on the issue queue! Tell us if you
+     - are experiencing the same problem
+     - have tried a suggested fix
+     - know of a potential solution or work-around
+     - have an opinion, idea or feedback of any kind!
+ - Be kind when interacting with others on Github! (see Code of Conduct below for further guidelines). We want to foster a welcoming, inclusive community!
+     - Constructive criticism is welcome and encouraged but should be worded such that it is helpful :-) Direct criticism towards the idea or solution rather than the person and focus on alternatives or improvements.
 
+# Code of Conduct
+
+Be nice! If that’s insufficient, Tripal community defers to https://www.contributor-covenant.org/
+
+# Required Dependencies
+* Drupal:
+  * Drupal 7.x
+  * Drupal core modules: Search, Path and PHP modules.
+  * Drupal contributed modules:
+    * [Views](http://drupal.org/project/views)
+    * [Entity API](http://drupal.org/project/entity)
+* PostgreSQL 9.3 or higher (9.5 required for Chado 1.2 to 1.3 upgrade)
+* PHP 5.5+
+* UNIX/Linux
 
 # Development Testing
 
-To run PHP unit tests on your local system, run `composer install` to install developer-specific requirements.  Next, create a `.env` file in your `/Tests/` directory that defines the `DRUPAL_ROOT` variable, for example 
+To run PHP unit tests on your local system, run `composer install` to install developer-specific requirements.  Next, create a `.env` file in your `/Tests/` directory that defines the `DRUPAL_ROOT` variable, for example
 
 ```
 DRUPAL_ROOT=/var/www/html
@@ -85,7 +83,7 @@ Then run PHPUnit from your root Tripal directory.
 
 PHPUnit tests will also be run in the Travis CI build.
 
-Read our [testing guidelines](tests/README.md)
+Read our [testing guidelines](https://tripal.readthedocs.io/en/latest/contributing/tests.html).
 
 ## Contributors
 
@@ -127,4 +125,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
 <!-- prettier-ignore-end -->
 <!-- ALL-CONTRIBUTORS-LIST:END -->
 
-This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
+This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

+ 17 - 3
docs/contributing/pull_requests.rst

@@ -63,7 +63,7 @@ The goal of this document is to make it easy for **A)** contributors to make pul
 - PRs that address a specific issue **must** link to the related issue page.
     - In almost every case, there should be an issue for a PR.  This allows feedback and discussion before the coding happens.  Not grounds to reject, but encourage users to create issues at start of their PR.  Better late than never :).
 - Each PR **must** be tested/approved by at least 1 contributor, if approved, a "trusted committer" will merge the PR.
-    - Testers **should** describe how the testing was performed if applicable (allows others to replicate the test).    
+    - Testers **should** describe how the testing was performed if applicable (allows others to replicate the test).
     - While Tripal's review body is small, the code review must be a thorough functional test.
     - At the Project Management Committee's (PMC) discretion, a PR may be subject to a non-functional review.  Generally these are small and obvious commits.
     - Tripal's guiding philosophy is to encourage open contribution.  With this in mind, committers should **work with contributors** to resolve issues in their PRs.  PRs that will not be merged should be closed, **transparently citing** the reason for closure.  In an ideal world, features that would be closed are discouraged at the **issue phase** before the code is written!
@@ -81,9 +81,23 @@ The goal of this document is to make it easy for **A)** contributors to make pul
 - PRs for new feature should remain open until adequately discussed (see guidelines below) and approved by a vote (all members of the PMC must vote in favour).
 
 
-.. note::
+How to create a PR
+^^^^^^^^^^^^^^^^^^^^^
+
+There are great instructions on creating a PR on `Digital Ocean: How To Create a Pull Request on GitHub <https://www.digitalocean.com/community/tutorials/how-to-create-a-pull-request-on-github>`_.
+
+**The tl;dr version:**
+
+1. `Fork the repository <https://docs.github.com/en/github/getting-started-with-github/fork-a-repo>`_ or `update an existing fork <https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork>`_
+2. `Clone <https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository>`_ the fork
+3. `Create a branch <https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging>`_ specific to your change: ``[issue\_number]-[tripal\_version]-[short\_description]``
+4. Make your changes, `committing <https://git-scm.com/docs/git-commit#_examples>`_ often with useful commit messages.
+5. `Push <https://git-scm.com/docs/git-push#_examples>`_ your changes to your fork.
+6. `Create a PR by going to your fork <https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork>`_: target should be ``tripal:7.x-3.x``. For specifics, see guidelines above.
+
+.. note:
 
-  If you need more instructions creating a pull request, see for example the `KnowPulse workflow <https://knowpulse.readthedocs.io/en/latest/developer_docs/dev_workflow.html#workflow>`_
+  If you are a `committer <>`_, you can clone the Tripal repository directly with no need to create or maintain a fork. Please make sure you are always creating new branches off of ``7.x-3.x`` and that you have pulled all recent changes to ``7.x-3.x`` before creating a new branch.
 
 How PRs and Issues are Handled
 ------------------------------

+ 2 - 2
docs/dev_guide/chado.rst

@@ -222,8 +222,8 @@ To check the existence of a specific table and column, you can use the following
 
       [ do your query, etc. here ]
 
-    } else { [warn the admin using tripal_repot_error()] }
-  } else { [warn the admin using tripal_repot_error()] }
+    } else { [warn the admin using tripal_report_error()] }
+  } else { [warn the admin using tripal_report_error()] }
 
 Checking the Schema Version
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

+ 3 - 3
docs/dev_guide/custom_data_loader.rst

@@ -331,7 +331,7 @@ To import data into Chado we will use the Tripal API. After splitting each line
     // We want to provide a progress report to the end-user so that they:
     // 1) Recognize that the loader is not hung if running a large file, but is
     //    executing
-    // 2) Provides some indicatation for how long the file will take to load.
+    // 2) Provides some indication for how long the file will take to load.
     //
     // Here we'll get the size of the file and tell the TripalImporter how
     // many "items" we have to process (in this case bytes of the file).
@@ -369,7 +369,7 @@ To import data into Chado we will use the Tripal API. After splitting each line
 
       // Using the name of the feature from the file, see if we can find a
       // record in the feature table of Chado that matches.  Note: in reality
-      // the feature table of Chado has a unique contraint on the uniquename,
+      // the feature table of Chado has a unique constraint on the uniquename,
       // organism_id and type_id columns of the feature table.  So, to ensure
       // we find a single record ideally we should include the organism_id and
       // type_id in our filter and that would require more widgets on our form!
@@ -450,7 +450,7 @@ In the code above we consider a byte as an item, and when all bytes from a file
 
 Testing Importers
 ------------------
-Unit Testing is a critically important component of any software project. You should always strive to write tests for your software.  Tripal provides unit testing using the ``phpunit`` testing framework. The Tripal Test Suite provides a strategy for adding tests for your new Importer.  It will automatically set up and bootstrap Drupal and Tripal for your testing environment, as well as provide database transactions for your tests, and factories to quickly generate data.  We will use the Tripal Test Suite to provide unit testing for our ``ExampelImporter``.
+Unit Testing is a critically important component of any software project. You should always strive to write tests for your software.  Tripal provides unit testing using the ``phpunit`` testing framework. The Tripal Test Suite provides a strategy for adding tests for your new Importer.  It will automatically set up and bootstrap Drupal and Tripal for your testing environment, as well as provide database transactions for your tests, and factories to quickly generate data.  We will use the Tripal Test Suite to provide unit testing for our ``ExampleImporter``.
 
 .. note::
   Before continuing, please install and configure Tripal Test Suite.

+ 2 - 2
docs/dev_guide/custom_field.rst

@@ -5,7 +5,7 @@ The most common way that new content will be added to an existing site is by cre
 
 By default Tripal v3 provides many fields for display of Chado data. However, you may find that these fields do not display data as you want, or you want to display data that the current fields do not already provide. This section of the Handbook describes how to create new fields that are integrated into the display, search and exchange abilities of both Drupal and Tripal.
 
-If you are already familiar with Drupal fields you may be aware of the API functions and hooks that Drupal provides.  However, for the quantity of fields needed to support biological data, the Drupal API hooks quickly become overwhelming.  Additionally, documentation for fields in the Drupal API can someitmes be difficult to discover when first working with fields.   Therefore, Tripal provides several new PHP classes to simplify creation of fields and to consolidate all functionality into one easy to find set of files.  To develop new fields you should be somewhat familiar working with PHP's Object-Oriented Classes. The new classes provided by Tripal are these:
+If you are already familiar with Drupal fields you may be aware of the API functions and hooks that Drupal provides.  However, for the quantity of fields needed to support biological data, the Drupal API hooks quickly become overwhelming.  Additionally, documentation for fields in the Drupal API can sometimes be difficult to discover when first working with fields.   Therefore, Tripal provides several new PHP classes to simplify creation of fields and to consolidate all functionality into one easy to find set of files.  To develop new fields you should be somewhat familiar working with PHP's Object-Oriented Classes. The new classes provided by Tripal are these:
 
 
 +----------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
@@ -13,7 +13,7 @@ If you are already familiar with Drupal fields you may be aware of the API funct
 +----------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 | TripalField          | The TripalField class provides the basic information about a new field. It provides loaders for extracting data from the database and functions for querying data managed by the field.                                   |
 +----------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
-| TripalFieldWidget    | The TripalFieldWidget class provides the necessary form elements when editing and Entity to allow the end-user to edit the value of the field (if desired). It provides the necessary validators and submittor functions. |
+| TripalFieldWidget    | The TripalFieldWidget class provides the necessary form elements when editing and Entity to allow the end-user to edit the value of the field (if desired). It provides the necessary validators and submitter functions. |
 +----------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 | TripalFieldFormatter | The TripalFieldFormatter class provides the visualization of the field when viewed on the page.                                                                                                                           |
 +----------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

+ 1 - 1
docs/dev_guide/custom_field/ajax_custom_formatter.rst

@@ -36,7 +36,7 @@ The selector has specified that wrapper, and the AJAX callback function ``exampl
       $selected = isset($form_state['values']['featuremap_select']);
     }
 
-    // We need to provide a container for Dupal AJAX to replace.
+    // We need to provide a container for Drupal AJAX to replace.
     // Here we use a fieldset with a set ID which we can refer to below.
     $form['rendered_maps'] = [
       '#type' => 'fieldset',

+ 16 - 16
docs/dev_guide/custom_field/create_instance.rst

@@ -2,14 +2,14 @@ Attach Fields to Content Types
 ==============================
 In summary, creation of a new field requires creation of three classes that inherit from the ``TripalField``, ``TripalFieldWidget`` and ``TripalFieldFormatter`` base classes.  If the fields are created correctly and placed in the ``includes/TripalFields`` directory of your module then Tripal will automatically find them.  However, the field is not yet attached to any content type. They must be attached.  Fields can be attached programmatically or via the online Drupal interface by a site admin. 
 
-The hook_bundle_field_info() function
+The hook_bundle_fields_info() function
 -------------------------------------
- The three TripalField classes simply define how the field will function, but Drupal does not yet know about the field.  The ``hook_bundle_field_info`` function tells Drupal about your field. It must be implemented in a custom Drupal module, and provides an array that tells Drupal about the fields and the classes to use for the field.  Suppose we were creating a field named ``obi__genus`` which displays the Genus for a species and we have a custom module named ``tripal_org2``.  The hook function would be named ``tripal_org2_bundle_field_info()``:
+ The three TripalField classes simply define how the field will function, but Drupal does not yet know about the field.  The ``hook_bundle_fields_info`` function tells Drupal about your field. It must be implemented in a custom Drupal module, and provides an array that tells Drupal about the fields and the classes to use for the field.  Suppose we were creating a field named ``obi__genus`` which displays the Genus for a species and we have a custom module named ``tripal_org2``.  The hook function would be named ``tripal_org2_bundle_fields_info()``:
 
 .. code-block:: php
   :linenos:
 
-  function tripal_org2_bundle_field_info($entity_type, $bundle) {
+  function tripal_org2_bundle_fields_info($entity_type, $bundle) {
     $info = [];
     
     // Make sure this bundle is an organism (OBI:0100026) then we'll attach our 
@@ -38,15 +38,15 @@ This function receives as its second argument the ``$bundle`` object. This is th
 
 The settings indicate the field name, the field type, the cardinality (how many values are allowed), any default settings and the storage type.  Because we expect our data to come from Chado we set the ``field_chado_storage`` as the type.  The ``locked`` setting is set to FALSE indicating that Drupal will allow the field to be deleted if the site developer desires.
 
-When the site administrator navigates to **Administer > Structure > Tripal Content Types**, clicks on a content type, and then the **manage fields** tab, a link appears at the top titled **Checkfor new fields**.  When that link is clicked, this hook function is called.
+When the site administrator navigates to **Administer > Structure > Tripal Content Types**, clicks on a content type, and then the **manage fields** tab, a link appears at the top titled **Check for new fields**.  When that link is clicked, this hook function is called.
 
 Programmatically Attaching Fields
 ---------------------------------
-You probably want to programmatically attach fields to content types if your have existing data that you know should be made available. For example, an organism always has a genus and only one genus.  If we have a field that displays the genus for an organism then we will want it automatically attached on installation of our module.  We can do this programmatically using two hook functions: ``hook_bundle_field_info()`` and ``hook_bundle_instance_info()``.  Both functions are required to attach a field to a content type. 
+You probably want to programmatically attach fields to content types if your have existing data that you know should be made available. For example, an organism always has a genus and only one genus.  If we have a field that displays the genus for an organism then we will want it automatically attached on installation of our module.  We can do this programmatically using two hook functions: ``hook_bundle_fields_info()`` and ``hook_bundle_instances_info()``.  Both functions are required to attach a field to a content type. 
 
-The hook_bundle_instance_info() function.
+The hook_bundle_instances_info() function.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-The previous hook tells Drupal that our field exists and is allowed to be connected to the organism bundle.  Next we need to create an actual instance of this field for the bundle.  We do this with the ``hook_bundle_instance_info()`` function.  The format is the same as the previous hook but the info array is different.  For example:
+The previous hook tells Drupal that our field exists and is allowed to be connected to the organism bundle.  Next we need to create an actual instance of this field for the bundle.  We do this with the ``hook_bundle_instances_info()`` function.  The format is the same as the previous hook but the info array is different.  For example:
 
 .. code-block:: php
   :linenos:
@@ -106,11 +106,11 @@ Unique to this info array are the settings related to Chado.  Because we expect
  - ``auto_attach``:  set this to TRUE if you want the field to automatically be added to an entity when it is generated for viewing.  Set it to FALSE to allow the field to be added via AJAX. For fields that require time to load setting to FALSE is preferred. 
  
 .. note::
-  A base table is one that contains the primary records to which ancilliary data (e.g. properties, cross references, CV terms, publications, contacts, etc) are associated via linker tables. For example some base tables include: ``feature``, ``organism``, ``stock``, ``library``, etc.).  The ``base_table`` and ``chado_table`` will always be the same when you are mapping a field to data in a column in a base table. If your field maps data to a "linker" table where ancilliary data is stored then the ``chado_table`` will be the linker table.
+  A base table is one that contains the primary records to which ancillary data (e.g. properties, cross references, CV terms, publications, contacts, etc) are associated via linker tables. For example some base tables include: ``feature``, ``organism``, ``stock``, ``library``, etc.).  The ``base_table`` and ``chado_table`` will always be the same when you are mapping a field to data in a column in a base table. If your field maps data to a "linker" table where ancillary data is stored then the ``chado_table`` will be the linker table.
 
-Notice as well that the ``display`` and ``widget`` sections list the name of our TripalEntityWidget and TripalEntityFormatter calsses respectively.  This tells drupal to use our widget and formatter classes by default.
+Notice as well that the ``display`` and ``widget`` sections list the name of our TripalEntityWidget and TripalEntityFormatter classes respectively.  This tells drupal to use our widget and formatter classes by default.
 
-When the site administrator navigates to **Administer > Structure > Tripal Content Types**, clicks on a content type, and then the **manage fields** tab, a link appears at the top titled **Checkfor new fields**.  When that link is clicked, this hook function is called.  
+When the site administrator navigates to **Administer > Structure > Tripal Content Types**, clicks on a content type, and then the **manage fields** tab, a link appears at the top titled **Check for new fields**.  When that link is clicked, this hook function is called.  
 
 .. note::
 
@@ -118,21 +118,21 @@ When the site administrator navigates to **Administer > Structure > Tripal Conte
   
 Allowing Manual Attachment of Fields
 ------------------------------------
-Not all fields are created equal.  Some field can be added by the site developer to a bundle and some cannot.  When the ``TripalField`` class is implemented for a class the ``$no_ui`` parameter is set to indicate if a field can be added via the web interface or not.  See the :doc:`manual_field_creation` page for more details. But in short the following setting does not allow a field to be added using the web interface
+Not all fields are created equal.  Some fields can be added by the site developer to a bundle and some cannot.  When the ``TripalField`` class is implemented for a class the ``$no_ui`` parameter is set to indicate if a field can be added via the web interface or not.  See the :doc:`manual_field_creation` page for more details. But in short the following setting does not allow a field to be added using the web interface
 
 .. code-block::  php
 
- public static $no_ui = FALSE;
+ public static $no_ui = TRUE;
  
 The following setting will allow the field to be added:
 
 .. code-block::  php
 
- public static $no_ui = TRUE;
+ public static $no_ui = FALSE;
 
-Next, we must let Drupal know that our field exists.  We do this by adding an entry to the ``$info`` array of in the ``hook_bundle_field_info()`` function described above.  This lets Drupal know about our field. However, because we are not programmatically creating an instance of the field on a content type, but allowing the user to create them we do not need to implement the ``hook_bundle_instance_info()`` function. Instead, we must implement the ``hook_bundle_create_user_field()``.  This function is called when the user attempts to add our new field to a bundle.  One field that comes with Tripal is the ``chado_linker__prop`` field.  Most Chado base tables have an associated property table (e.g. ``organismprop``, ``featureprop``, ``stockprop``, etc). By default, the ``tripal_chado`` module automatically adds this field to all bundles that have existing properties. It adds a new instance for every property type.  However, new properties can be added to bundle, and the site admin may want to add those properties via the user interface rather. Therefore, this field has the ``$no_ui`` set to TRUE and uses the  ``hook_bundle_create_user_field()`` to create the new field instance for the user.
+Next, we must let Drupal know that our field exists.  We do this by adding an entry to the ``$info`` array in the ``hook_bundle_fields_info()`` function described above.  This lets Drupal know about our field. However, because we are not programmatically creating an instance of the field on a content type, but allowing the user to create them we do not need to implement the ``hook_bundle_instances_info()`` function. Instead, we must implement ``hook_bundle_create_user_field()``.  This function is called when the user attempts to add our new field to a bundle.  One field that comes with Tripal is the ``chado_linker__prop`` field.  Most Chado base tables have an associated property table (e.g. ``organismprop``, ``featureprop``, ``stockprop``, etc). By default, the ``tripal_chado`` module automatically adds this field to all bundles that have existing properties. It adds a new instance for every property type.  However, new properties can be added to bundle, and the site admin may want to add those properties via the user interface rather. Therefore, this field has the ``$no_ui`` set to TRUE and uses the  ``hook_bundle_create_user_field()`` to create the new field instance for the user.
 
-The following code is a snippet from the ``tripal_chado_bundle_create_user_field`` function of the ``tripal_chado`` module. Note that it uses the ``field_create_field`` function and the ``field_create_instance`` functions directly.  The arrays passed to these functions are identical to the ``$info`` arrays of both the ``hook_bundle_field_info`` and ``hook_bundle_instance_info`` functions described above.
+The following code is a snippet from the ``tripal_chado_bundle_create_user_field`` function of the ``tripal_chado`` module. Note that it uses the ``field_create_field`` function and the ``field_create_instance`` functions directly.  The arrays passed to these functions are identical to the ``$info`` arrays of both the ``hook_bundle_fields_info`` and ``hook_bundle_instances_info`` functions described above.
 
 .. code-block:: php
   :linenos:
@@ -218,6 +218,6 @@ The following code is a snippet from the ``tripal_chado_bundle_create_user_field
 
 .. note::
   
-  It is possible to have a field that is both programmtically attached to some content types but is also allowed to be attached to another content type by the site admin using the web interface. To do this, programmatically add the field to the content types using the ``hook_bundle_instance_info`` function and also implement the ``hook_bundle_create_user_field`` function to support manual adding.
+  It is possible to have a field that is both programmatically attached to some content types but is also allowed to be attached to another content type by the site admin using the web interface. To do this, programmatically add the field to the content types using the ``hook_bundle_instances_info`` function and also implement the ``hook_bundle_create_user_field`` function to support manual adding.
   
  

+ 6 - 6
docs/dev_guide/custom_field/custom_formatter.rst

@@ -64,11 +64,11 @@ You may recall that the ``$items`` array structure is the same as that created b
 
 Because our organisms are also published entities we want to link to their respective pages each time an organism is displayed.  Because the ``value`` array has an element named ``entity`` we know that this item is published.  Lines 5-6 of the ``view()`` function shown above use this information to create a clickable link to the organism page.   Finally, the ``$element`` argument is set to provide content of type ``markup``.  This ``$element`` array is a `Drupal renderable array <https://www.drupal.org/docs/7/api/render-arrays/render-arrays-overview>`_.
 
-Lastly, notice the element named ``chado-feature__organsim_id``.  This element is at the same level as the ``value`` element.  This data is meant to be used internally by the field. It maps this fields values to the appropriate table in Chado where the data is stored.  
+Lastly, notice the element named ``chado-feature__organism_id``.  This element is at the same level as the ``value`` element.  This data is meant to be used internally by the field. It maps this fields values to the appropriate table in Chado where the data is stored.  
 
 .. warning:: 
 
-  You should never show the user any data that is outside of ``value`` element.  Remember that your field can be shown by other viewers, including web services.  By ensuring that data in the ``value`` element is mean to be displayed we ensure that information on the web page, web services, or any othe future form of display is always consistent.
+  You should never show the user any data that is outside of ``value`` element.  Remember that your field can be shown by other viewers, including web services.  By ensuring that data in the ``value`` element is mean to be displayed we ensure that information on the web page, web services, or any other future form of display is always consistent.
 
 In summary, the following should be observed when processing the ``$items`` array for viewing:
 
@@ -81,11 +81,11 @@ In summary, the following should be observed when processing the ``$items`` arra
 
 .. warning::
 
-  You should never have SQL statements or any API calls that retrieve data in the foramter ``view()`` function. The formatter should strictly format data for viewing.
+  You should never have SQL statements or any API calls that retrieve data in the formatter ``view()`` function. The formatter should strictly format data for viewing.
   
 Creating Pagers
 ~~~~~~~~~~~~~~~
-The example shown in the previous section was for a field that will always only contain a single element.  However some fields may contain a large number of elements.  Consider an mRNA and it's relationships to subfeatures: exons, 5' UTRs, 3'UTRs, CDS, etc.).  A large mRNA can have many relationships.  Alternatively, consider the case where a genentic map content type may have a field that lists all of the markers on the map.  Such a list could become extremely long on the page.  In these cases it may be best to only list a few items at a time and to provide a pager to let the user cycle through the items.  An example of a pager added to the bottom of relationships is shown in the example below.
+The example shown in the previous section was for a field that will always only contain a single element.  However some fields may contain a large number of elements.  Consider an mRNA and it's relationships to subfeatures: exons, 5' UTRs, 3'UTRs, CDS, etc.).  A large mRNA can have many relationships.  Alternatively, consider the case where a genetic map content type may have a field that lists all of the markers on the map.  Such a list could become extremely long on the page.  In these cases it may be best to only list a few items at a time and to provide a pager to let the user cycle through the items.  An example of a pager added to the bottom of relationships is shown in the example below.
 
 .. image:: custom_formatter.pager.1.png
 
@@ -132,7 +132,7 @@ Now that we have a pager, it has been setup for AJAX and we know the current pag
     
 The settingsForm() Function.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Sometimes you may want to provide some control to the site developer for the formatter.  For example, the ``sbo__relationship_formater`` allows the site developer to customize the title that appears above the table that houses relationships and the text the appears if there are no relationships.  By default the title is "Relationships" and the empty text indicates there are no relationships. Both are a bit too generic.  The ``settingsForm()`` function allows you to provide a Drupal form for the field that appears on the **Administer > Strucutre > Tripal Content Types** on any content type's **manage display** page:
+Sometimes you may want to provide some control to the site developer for the formatter.  For example, the ``sbo__relationship_formatter`` allows the site developer to customize the title that appears above the table that houses relationships and the text the appears if there are no relationships.  By default the title is "Relationships" and the empty text indicates there are no relationships. Both are a bit too generic.  The ``settingsForm()`` function allows you to provide a Drupal form for the field that appears on the **Administer > Structure > Tripal Content Types** on any content type's **manage display** page:
 
 .. image:: custom_formatter.settings.1.png
 
@@ -162,7 +162,7 @@ The form shown in the screenshot above is provided by the ``settingsForm()`` fun
   
 The form is typical of any form.  Note, however that the ``#default_value`` is set using the current settings values.
 
-A settings form is useful but it only works when Drupal knows what settings you want for your field.  You must provide the settings names (e.g. "title" and "empty" in this case) when you  attach your field to a given content type (i.e. bundle).  You tell Drupal to attach this field to a content type using the ``hook_bundle_instance_info`` function.  See 
+A settings form is useful but it only works when Drupal knows what settings you want for your field.  You must provide the settings names (e.g. "title" and "empty" in this case) when you  attach your field to a given content type (i.e. bundle).  You tell Drupal to attach this field to a content type using the ``hook_bundle_instances_info`` function.  See 
 the :doc:`create_instance` to learn more about this function.  Briefly, the ``display`` section of the info array for the ``sbo__relationship`` field contains the following settings for the ``display``:
 
 .. code-block:: php

+ 2 - 2
docs/dev_guide/custom_field/custom_widget.rst

@@ -108,7 +108,7 @@ For our ``obi__organism`` example, the drop-down returns the chado organism_id o
     }
   }
 
-But what do you do if the record you want to link to via foreign key constraint doesn't yet exist? Luckily the Chado Storage API has a solution for this as well. Consider the example of the ``sbo__relationship_widget``. When this widget is on the create form for a given content type, we will first need to create the base record before we can create a relationship to it. This is done by setting the values you do know (e.g. ``chado-feature__type_id`` and ``chado-feature__object_id``) but nnot setting the column mapping to the base record. The Chado Storage API will then fill it in automatically once the base record is created.
+But what do you do if the record you want to link to via foreign key constraint doesn't yet exist? Luckily the Chado Storage API has a solution for this as well. Consider the example of the ``sbo__relationship_widget``. When this widget is on the create form for a given content type, we will first need to create the base record before we can create a relationship to it. This is done by setting the values you do know (e.g. ``chado-feature__type_id`` and ``chado-feature__object_id``) but not setting the column mapping to the base record. The Chado Storage API will then fill it in automatically once the base record is created.
 
 .. code-block:: php
 
@@ -150,4 +150,4 @@ But what do you do if the record you want to link to via foreign key constraint
 
 Drupal typically does not provide a submit hook for fields because, as mentioned above, saving should be done by the storage backend. However, the TripalField provides a ``TripalFieldWidget::submit()`` to allow for behind-the-scenes actions to occur. This function should never be used for updates, deletes or inserts for the Chado table associated with the field as these actions should be handled by the storage backend.
 
-However, it is permissible to perform inserts, updates or deletions within Chado using this function.  Those operations can be performed if needed but on other tables not directly associated with the field. An example is the ``chado.feature_synonym`` table.  The ``chado_linker__synonym`` field allows the user to provide a brand new synonynm and it must add it to the chado.synonym table prior to the record in the chado.feature_synonym table.
+However, it is permissible to perform inserts, updates or deletions within Chado using this function.  Those operations can be performed if needed but on other tables not directly associated with the field. An example is the ``chado.feature_synonym`` table.  The ``chado_linker__synonym`` field allows the user to provide a brand new synonym and it must add it to the chado.synonym table prior to the record in the chado.feature_synonym table.

+ 10 - 10
docs/dev_guide/custom_field/manual_field_creation.rst

@@ -60,15 +60,15 @@ As described in the section titled Tripal Data Structures, fields that are attac
 .. code-block:: php
 
   
-  // Provide a list of instance specific settings. These can be access within
+  // Provide a list of instance specific settings. These can be accessed within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
-  // then Drupal with automatically change these settings for the instance.
+  // then Drupal will automatically change these settings for the instance.
   // It is recommended to put settings at the instance level whenever possible.
   // If you override this variable in a child class be sure to replicate the
   // term_name, term_vocab, term_accession and term_fixed keys as these are
   // required for all TripalFields.
   public static $default_instance_settings  = array(
-    // The short name for the vocabulary (e.g. shcema, SO, GO, PATO, etc.).
+    // The short name for the vocabulary (e.g. schema, SO, GO, PATO, etc.).
     'term_vocabulary' => 'OBI',
     // The name of the term.
     'term_name' => 'organism',
@@ -121,12 +121,12 @@ Sometimes a field is meant to provide a visualization or some other functionalit
   public static $no_data = FALSE;
 
 
-  .. note::
+.. note::
   Be sure to only set this to TRUE when you are absolutely certain the contents would not be needed in web services.  Tripal was designed so that what appears on the page will always appear in web services.  Aside form the formatting we see on the website, the content should be the same.
 
 Finally, the last item in our Class variables is the **download_formatters**.  Tripal provides an API that allows tools to group entities into data collections.  Data collections are like "baskets" or "shopping carts".   Entities that are in data collections can be downloaded into files.  If your field is compatible with specific file downloaders you can specify those here.  A file downloader is a special TripalFieldDownloader class that "speaks" certain file formats.  Tripal, by default, provides the TripalTabDownloader (for tab-delimited files), the TripalCSVDownloader (for CSV files), a TripalNucFASTADownloader for creating nucleotide FASTA files and a TripalProteinFASTADownloader for protein FASTA files.   If your field is compatible with any of these formatters you can specify them in the following array:
 
-.. .. code-block::
+.. code-block::
 
   // Indicates the download formats for this field.  The list must be the
   // name of a child class of the TripalFieldDownloader.
@@ -156,7 +156,7 @@ Because this is a ChadoField and the TripalChado module supports this field and
 
     $record = $entity->chado_record;
 
-Having the record helps tremendously.  Our **obi__organism** field is meant to be attached to genomic feature content types (e.g. genes, mRNA, etc.), germplasm, etc.  Therefore, the entity will be a record of one of those types. In the case of a genomic feature, these come from the **feature** table of Chado.  In the case of a germplam, these records come from the **stock** table of Chado.  Both of these records have an **organism_id** field which is a foreign key to the organism table where we find out details about the organism.
+Having the record helps tremendously.  Our **obi__organism** field is meant to be attached to genomic feature content types (e.g. genes, mRNA, etc.), germplasm, etc.  Therefore, the entity will be a record of one of those types. In the case of a genomic feature, these come from the **feature** table of Chado.  In the case of germplasm, these records come from the **stock** table of Chado.  Both of these records have an **organism_id** field which is a foreign key to the organism table where we find out details about the organism.
 
 Before we set the values for our field, we need a little bit more information.  Remember that all field instances have settings?   The Tripal Chado module also populates for us the name of the Chado table and the column that this field maps to.  Our obi__organism field can be used for multiple Bundles.  A gene bundle would map to the **feature** table of Chado and a germplasm Bundle would map to the **stock** table.  We need to know what table and column this field is mapping to:  We can get that from the instance object of the class and its settings:
 
@@ -186,7 +186,7 @@ Now, let's plan how we want our values to appear in our field.  The organism rec
     $infraspecific_type_term = tripal_get_chado_semweb_term('organism', 'type_id');
 
 
-Notice that for our organism fields we can easily get the ontology terms for them using the API function **tripal_get_chado_semweb_term**.  You will also notice a **label_term** variable.  Sometimes a user may want to see the full name of the organism and not pieces of it in various elements.  Therefore, we will provide a label in our list of values that will concatenate the full organism name.  This field is not in our organism table so we hard-code the term 'rdfs:lable' which is a term from the Resource Data Framework Schema vocabulary that defines a label.
+Notice that for our organism fields we can easily get the ontology terms for them using the API function **tripal_get_chado_semweb_term**.  You will also notice a **label_term** variable.  Sometimes a user may want to see the full name of the organism and not pieces of it in various elements.  Therefore, we will provide a label in our list of values that will concatenate the full organism name.  This field is not in our organism table so we hard-code the term 'rdfs:label' which is a term from the Resource Data Framework Schema vocabulary that defines a label.
 
 Next, let's initialize our field's value to be empty.  When setting a field value we must do so in the entity object that got passed into our load function.  The entity is an object and it stores values using the names of the fields.  The following code sets an empty record for our field:
 
@@ -392,9 +392,9 @@ The code above generates and returns an associative array that provides metadata
       'type' => 'xs:complexType',
       'elements' => array(
 
-Notice the value for $field_term variable was easily obtained by calling the $this->getFieldTermID function and all of the terms for the elements were obtained using the chado_get_semweb_term function which maps table columns in the Chado database schema to ontology terms.  The operations key indicates which search filter operations are supported for the field as a whole.  For this example these include 'eq' (for equals), 'contains' and 'starts' (for starts with).   The field is sortable and searchable so those values are set to TRUE.   Later, we weill learn how to implement the sorting, searching and filtering that the field will support.  For now we know we want them so we set the values accordingly.  Additionally, the field allows updating so 'readonly' is set to FALSE.   By convention, the 'type' of a field follows the XML data types for simple types (https://www.w3schools.com/xml/schema_simple.asp) and Complex types (https://www.w3schools.com/xml/schema_complex.asp) that have multiple elements.  Because our obi__organism field has subelements  and is not a single value, the field type is 'xs:complexType'.
+Notice the value for $field_term variable was easily obtained by calling the $this->getFieldTermID function and all of the terms for the elements were obtained using the chado_get_semweb_term function which maps table columns in the Chado database schema to ontology terms.  The operations key indicates which search filter operations are supported for the field as a whole.  For this example these include 'eq' (for equals), 'contains' and 'starts' (for starts with).   The field is sortable and searchable so those values are set to TRUE.   Later, we will learn how to implement the sorting, searching and filtering that the field will support.  For now we know we want them so we set the values accordingly.  Additionally, the field allows updating so 'readonly' is set to FALSE.   By convention, the 'type' of a field follows the XML data types for simple types (https://www.w3schools.com/xml/schema_simple.asp) and Complex types (https://www.w3schools.com/xml/schema_complex.asp) that have multiple elements.  Because our obi__organism field has subelements  and is not a single value, the field type is 'xs:complexType'.
 
-The array keys just mentioned fully describe our field to Drupal and Tripal.  Next we will define the sub elements in the same way, and these go in the 'elements' key.  First, we will describe the label.  Our obi__oranganism field provides a handly label element that concatenates the genus, species and infraspecific name into one simple string.  Therefore, we need to describe this element in the same way we described the field itself.  In the code below that the key is set to 'rdfs:label' (which is the controlled vocabulary term for a label) and that the child keys are the same as for the field.
+The array keys just mentioned fully describe our field to Drupal and Tripal.  Next we will define the sub elements in the same way, and these go in the 'elements' key.  First, we will describe the label.  Our obi__organism field provides a handy label element that concatenates the genus, species and infraspecific name into one simple string.  Therefore, we need to describe this element in the same way we described the field itself.  In the code below that the key is set to 'rdfs:label' (which is the controlled vocabulary term for a label) and that the child keys are the same as for the field.
 
 .. code-block:: php
 
@@ -494,7 +494,7 @@ As described above in the elementInfo function section, some fields and elements
       }
     }
 
-The code above is how the field tells Drupal and Tripal how to find and filter the records that this field corresponds to.  First, we retrieve the field alias and operators:and as with the load and elementInfo functions we get the controlled vocabulary terms for our field and field elements:
+The code above is how the field tells Drupal and Tripal how to find and filter the records that this field corresponds to.  First, we retrieve the field alias and operators, and as with the load and elementInfo functions we get the controlled vocabulary terms for our field and field elements:
 
 
 .. code-block:: php

+ 2 - 2
docs/dev_guide/custom_web_services.rst

@@ -141,7 +141,7 @@ Notice currently all this function does is call the parent getDocumentation func
 
 In the above array, notice the @id is URL that represents a unique identifier for the class.   The @type will always be 'hydra:Class' because we are documenting a resource.  Then there is information about the class defined using the 'hydra:title' and 'hydra:description'.  The 'subclassOf' is always set to 'hydra:Resource'.  Next is the list of supported operations for this resource.  Remember, in our design we only want to support the GET operation for our Jobs service, so just like in the example above, the method we will support is GET.  The key/value pairs for the GET method are described using Hydra terms.  
 
-For our services we need to provide the information to Tripal so that it can generate these Hydra JSON arrays that document our service.  Tripal provides some easy API functions to help with this.  The firt is the **addDoc** member function.  This function will take as input the class details, operations and properties necessary to generate the documentation for our class.  First, lets use this function to document our Jobs Collection resource.  Below is sample code that will do this for us.
+For our services we need to provide the information to Tripal so that it can generate these Hydra JSON arrays that document our service.  Tripal provides some easy API functions to help with this.  The first is the **addDoc** member function.  This function will take as input the class details, operations and properties necessary to generate the documentation for our class.  First, lets use this function to document our Jobs Collection resource.  Below is sample code that will do this for us.
 
 
 .. code-block:: php
@@ -290,7 +290,7 @@ Now, because we have instantiated a TripalWebServiceCollection object it can han
 
         $this->resource->initPager($num_records, $limit, $page);
 
-Lastly, we need to add our "members" of the collection.  These are the jobs from our query.  The following for loop iterates through alll of our jobs and creates new member objects that are added to our collection:
+Lastly, we need to add our "members" of the collection.  These are the jobs from our query.  The following for loop iterates through all of our jobs and creates new member objects that are added to our collection:
 
 .. code-block:: php
 

+ 1 - 1
docs/dev_guide/data_structures.rst

@@ -1,7 +1,7 @@
 Tripal Data Structures
 =======================
 
-This page explains the relationships between Entity types, Bundles (content type), Entities and Fields. These are data structures provided by Drupal that Tripal v3 uses to expose biological content through your Drupal site, and to provide flexibility in site customization.  It is important to understand these terms and their relationships before developing new modules or custom functionlaity.   A quick summary of these Drupal data structures are as follows:
+This page explains the relationships between Entity types, Bundles (content type), Entities and Fields. These are data structures provided by Drupal that Tripal v3 uses to expose biological content through your Drupal site, and to provide flexibility in site customization.  It is important to understand these terms and their relationships before developing new modules or custom functionality.   A quick summary of these Drupal data structures are as follows:
 
 * Entity:  a discrete data record.  Entities are most commonly are seen as "pages" on a Drupal web site.
 * Field:  an "atomic" piece of ancillary data that describes, defines or expands the entity.  Common fields include the name of an entity, a "body" of descriptive text, etc.

+ 1 - 1
docs/dev_guide/exporting_field_settings.rst

@@ -56,7 +56,7 @@ Configuring the bundle fields
 
 To begin, let's quickly configure a bundle.  Navigate to the structure of your site and select Analysis (**Admin ->Structure -> Tripal Content -> Analysis -> Manage Fields**).  Scroll to the bottom and add a new field of type File, with a machine name of ``field_fasta_file‎``, and click **Save**. Be sure to change the **Allowed extensions** parameter to accept ``.fasta``, otherwise, it will only allow `.txt` files to be uploaded.  You may also want to increase the file size limit, as the default 2MB can be too small for many FASTA files.
 
-We now have to pick a CV term for our field.  Because we are providing a FASTA file field, we can use a term such as FASTA `(SWO:0000142 <https://www.ebi.ac.uk/ols/ontologies/ero/terms?iri=http%3A%2F%2Fwww.ebi.ac.uk%2Fefo%2Fswo%2FSWO_0000142>`_.  Please see  :ref:`adding_a_cvterm` for help loading a term.  Once the term is in our DB, we can assign it to this field.
+We now have to pick a CV term for our field.  Because we are providing a FASTA file field, we can use a term such as FASTA (`SWO:0000142 <https://www.ebi.ac.uk/ols/ontologies/ero/terms?iri=http%3A%2F%2Fwww.ebi.ac.uk%2Fefo%2Fswo%2FSWO_0000142>`_).  Please see  :ref:`adding_a_cvterm` for help loading a term.  Once the term is in our DB, we can assign it to this field.
 
 
 .. image:: ./exporting_field_settings.1.assign_term.png

+ 1 - 1
docs/user_guide/install_tripal/custom_theme.rst

@@ -7,7 +7,7 @@ Drupal makes it easy to change the look-and-feel of your site by providing Theme
 
 Customizing a Theme
 -------------------
-If you want to make customizations to the theme you should create your own sub theme.  A sub theme borrows from an existing **base theme** (e.g. Bartik) and allows you to make your customizations.  Thus, when updates for a theme are released you can easily upgrade your base theme without losing your changes.   To create a sub theme, follow the instructions on the `Creating a sub-theme page <https://www.drupal.org/docs/7/theming/creating-a-sub-theme>`_ on the Drupal website.  Alternatively, completely custom themes do not borrow from any othe theme, you can create your own full-blown theme by following the `Themeing instructions <https://www.drupal.org/docs/7/theming>`_ at the Drupal website.
+If you want to make customizations to the theme you should create your own sub theme.  A sub theme borrows from an existing **base theme** (e.g. Bartik) and allows you to make your customizations.  Thus, when updates for a theme are released you can easily upgrade your base theme without losing your changes.   To create a sub theme, follow the instructions on the `Creating a sub-theme page <https://www.drupal.org/docs/7/theming/creating-a-sub-theme>`_ on the Drupal website.  Alternatively, completely custom themes do not borrow from any other theme, you can create your own full-blown theme by following the `Themeing instructions <https://www.drupal.org/docs/7/theming>`_ at the Drupal website.
 
 .. note::
 

+ 1 - 1
docs/user_guide/install_tripal/server_setup.rst

@@ -6,7 +6,7 @@ Before installation of Tripal, a web server must be configured and ready, and Tr
 1. A UNIX-based server (e.g. Ubuntu Linux or CentOS are the most popularly used).
 2. Web server software. The `Apache web server <https://httpd.apache.org/>`_ is most commonly used.
 3. `PHP <http://php.net/>`_ version 5.6 or higher (the most recent version is recommended).
-4. `PostgreSQL <https://www.postgresql.org/>`_ 9.3 or higher
+4. `PostgreSQL <https://www.postgresql.org/>`_ 9.3 or higher (9.5 required for Chado 1.2 to 1.3 upgrade)
 5. `Drush <http://www.drush.org/en/master/>`_ 7 or higher
 6. `Drupal <https://www.drupal.org/>`_ 7.
 

+ 1 - 1
legacy/tripal_analysis/tripal_analysis.views_default.inc

@@ -38,7 +38,7 @@ function tripal_analysis_views_default_views() {
 function tripal_analysis_defaultvalue_user_analysis() {
 
   // As a shortcut, currently I am copying the admin view and then tweaking it
-  // In thie future this should be replaced by a views export
+  // In the future this should be replaced by a views export
   $view = tripal_analysis_defaultvalue_admin_analysis();
 
   // change some view admin stuff

+ 1 - 1
legacy/tripal_contact/tripal_contact.views_default.inc

@@ -37,7 +37,7 @@ function tripal_contact_views_default_views() {
 function tripal_contact_defaultvalue_user_contacts() {
 
   // As a shortcut, currently I am copying the admin view and then tweaking it
-  // In thie future this should be replaced by a views export
+  // In the future this should be replaced by a views export
   $view = tripal_contact_defaultview_admin_contacts();
 
   // change some view admin stuff

+ 1 - 1
legacy/tripal_core/api/tripal_core.chado_nodes.api.inc

@@ -774,7 +774,7 @@ function chado_node_sync_form_submit($form, $form_state) {
  *   sync.
  * @param $organism_id
  *   Optional: Limit the list of records to be synced to only those that
- *   are associated with this organism_id. If the record is not assocaited
+ *   are associated with this organism_id. If the record is not associated
  *   with an organism then this field is not needed.
  * @param $types
  *   Optional: Limit the list of records to be synced to only those that

+ 1 - 1
legacy/tripal_feature/theme/templates/tripal_feature_alignments.tpl.php

@@ -27,7 +27,7 @@
 *
 * Alignment context #2:
 * ---------------------
-* If the feature for this node is the child in the alignment relationsips,
+* If the feature for this node is the child in the alignment relationships,
 * then those alignments are available in this variable:
 * 
 *   $feature->featureloc->feature_id;

+ 1 - 1
legacy/tripal_featuremap/tripal_featuremap.views_default.inc

@@ -35,7 +35,7 @@ function tripal_featuremap_views_default_views() {
 function tripal_featuremap_defaultvalue_user_featuremaps() {
 
   // As a shortcut, currently I am copying the admin view and then tweaking it
-  // In thie future this should be replaced by a views export
+  // In the future this should be replaced by a views export
   $view = tripal_featuremap_defaultview_admin_featuremaps();
 
   // change some view admin stuff

+ 1 - 1
legacy/tripal_genetic/tripal_genetic.views_default.inc

@@ -35,7 +35,7 @@ function tripal_genetic_views_default_views() {
 function tripal_genetic_defaultvalue_user_genotypes() {
 
   // As a shortcut, currently I am copying the admin view and then tweaking it
-  // In thie future this should be replaced by a views export
+  // In the future this should be replaced by a views export
   $view = tripal_genetic_defaultviews_admin_genotypes();
 
   // change some view admin stuff

+ 1 - 1
legacy/tripal_library/tripal_library.views_default.inc

@@ -35,7 +35,7 @@ function tripal_library_views_default_views() {
 function tripal_library_defaultvalue_user_library() {
 
   // As a shortcut, currently I am copying the admin view and then tweaking it
-  // In thie future this should be replaced by a views export
+  // In the future this should be replaced by a views export
   $view = tripal_library_admin_defaultviews_library();
 
   // change some view admin stuff

+ 1 - 1
legacy/tripal_organism/includes/tripal_organism.chado_node.inc

@@ -688,7 +688,7 @@ function tripal_organism_node_presave($node) {
     case 'chado_organism':
       // when syncing the details are not present in the $node object
       // as they are when submitted via the form.  Therefore, if we do
-      // not see any field values from the form, we assume this fucntion
+      // not see any field values from the form, we assume this function
       // is being called for syncing, so we must set the title accordingly
       if (property_exists($node, 'genus')) {
         $node->title = $node->genus . " " . $node->species;

+ 1 - 1
legacy/tripal_phenotype/tripal_phenotype.views_default.inc

@@ -35,7 +35,7 @@ function tripal_phenotype_views_default_views() {
 function tripal_phenotype_defaultvalue_user_phenotypes() {
 
   // As a shortcut, currently I am copying the admin view and then tweaking it
-  // In thie future this should be replaced by a views export
+  // In the future this should be replaced by a views export
   $view = tripal_phenotype_defaultview_admin_phenotypes();
 
   // change some view admin stuff

+ 129 - 110
legacy/tripal_phylogeny/theme/js/tripal_phylogeny.js

@@ -2,129 +2,148 @@
 
 (function ($) {
 
-  var height = 0; // will be dynamically sized
+  "use strict";
 
-  $(document).ready( function () {
+  // Will be dynamically sized.
+  var height = 0;
 
-    // Callback function to determine node size.
-    var nodeSize = function(d) {
-      var size;
-      if (d.cvterm_name == "phylo_root") {
-        size = treeOptions['root_node_size']; 
-      }
-      if (d.cvterm_name == "phylo_interior") {
-        size = treeOptions['interior_node_size']; 
-      }
-      if (d.cvterm_name == "phylo_leaf") {
-        size = treeOptions['leaf_node_size']; 
-      }
-      return size;
+  // Store our function as a property of Drupal.behaviors.
+  Drupal.behaviors.TripalPhylotree = {
+    attach: function (context, settings) {
+
+      // Retrieve the data for this tree.
+      var data_url = Drupal.settings.tripal_chado.phylotree_url;
+      $.getJSON(data_url, function(treeData) {
+        phylogeny_display_data(treeData);
+        $('.phylogram-ajax-loader').hide();
+      });
     }
+  }
 
-    // Callback function to determine the node color.
-    var organismColor = function(d) {
-      var color = null;
-      if (d.genus) {
-        color = organismColors[d.genus + ' ' + d.species];
-      }
-      if (color) { 
-        return color; 
-      }
-      else { 
-        return 'grey'; 
-      }
-    };
+  // Callback function to determine node size.
+  var phylogeny_node_size = function(d) {
+    var size;
+    var tree_options = Drupal.settings.tripal_chado.tree_options;
+    if (d.cvterm_name == "phylo_root") {
+      size = tree_options['root_node_size'];
+    }
+    if (d.cvterm_name == "phylo_interior") {
+      size = tree_options['interior_node_size'];
+    }
+    if (d.cvterm_name == "phylo_leaf") {
+      size = tree_options['leaf_node_size'];
+    }
+    return size;
+  }
 
-    // Callback for mouseover event on graph node d.
-    var nodeMouseOver = function(d) {
-      var el = $(this);
-      el.attr('cursor', 'pointer');
-      var circle = el.find('circle');
-      // highlight in yellow no matter if leaf or interior node
-      circle.attr('fill', 'yellow');
-      if(!d.children) {
-        // only leaf nodes have descriptive text
-        var txt = el.find('text');
-        txt.attr('font-weight', 'bold');
-      }
-    };
-    
-    // Callback for mouseout event on graph node d.
-    var nodeMouseOut = function(d) {
-      var el = $(this);
-      el.attr('cursor', 'default');
-      var circle = el.find('circle');
-      if(!d.children) {
-        // restore the color based on organism id for leaf nodes
-        circle.attr('fill', organismColor(d));
-        var txt = el.find('text');
-        txt.attr('font-weight', 'normal');
+  // Callback function to determine the node color.
+  var phylogeny_organism_color = function(d) {
+    var organism_color = Drupal.settings.tripal_chado.org_colors;
+    var color = null;
+
+    if (d.fo_genus) {
+      color = organism_color[d.fo_organism_id];
+    }
+    if (color) {
+      return color;
+    }
+    else {
+      return 'grey';
+    }
+  };
+
+  // Callback for mouseover event on graph node d.
+  var phylogeny_node_mouse_over = function(d) {
+    var el = $(this);
+    el.attr('cursor', 'pointer');
+    var circle = el.find('circle');
+    // highlight in yellow no matter if leaf or interior node
+    circle.attr('fill', 'yellow');
+    if(!d.children) {
+      // only leaf nodes have descriptive text
+      var txt = el.find('text');
+      txt.attr('font-weight', 'bold');
+    }
+  };
+
+  // Callback for mouseout event on graph node d.
+  var phylogeny_node_mouse_out = function(d) {
+    var el = $(this);
+    el.attr('cursor', 'default');
+    var circle = el.find('circle');
+    if(!d.children) {
+      // restore the color based on organism id for leaf nodes
+      circle.attr('fill', phylogeny_organism_color(d));
+      var txt = el.find('text');
+      txt.attr('font-weight', 'normal');
+    }
+    else {
+      // restore interior nodes to white
+      circle.attr('fill', 'white');
+    }
+  };
+
+  // Callback for mousedown/click event on graph node d.
+  var phylogeny_node_mouse_down = function(d) {
+    var el = $(this);
+    var title = (! d.children ) ? d.name : 'interior node ' + d.phylonode_id;
+
+    if(d.children) {
+      // interior node
+      if(d.phylonode_id) {
       }
       else {
-        // restore interior nodes to white
-        circle.attr('fill', 'white');
+        // this shouldn't happen but ok
       }
-    };
-    
-    // Callback for mousedown/click event on graph node d.
-    var nodeMouseDown = function(d) {
-      var el = $(this);
-      var title = (! d.children ) ? d.name : 'interior node ' + d.phylonode_id;
+    }
+    else {
+      if(d.feature_eid) {
+        window.location.href = baseurl + '/bio_data/' + d.feature_eid;
 
-      if(d.children) {
-        // interior node
-        if(d.phylonode_id) {
-        }
-        else {
-          // this shouldn't happen but ok
-        }
+        return;
       }
-      else {
-        // If this node is not associated with a feature but it has an 
-        // organism node then this is a taxonomic node and we want to
-        // link it to the organism page.
-        if (!d.feature_id && d.organism_node_id) {
-          window.location.replace(baseurl + '/node/' + d.organism_node_id);
-        }
-        // leaf node
+      // If this node is not associated with a feature but it has an
+      // organism node then this is a taxonomic node and we want to
+      // link it to the organism page.
+      if (!d.feature_id && d.organism_nid) {
+        window.location.replace(baseurl + '/node/' + d.organism_nid);
+      }
+      if (!d.feature_id && d.organism_eid) {
+        window.location.replace(baseurl + '/bio_data/' + d.organism_eid);
       }
-    };
+      // leaf node
+    }
+  };
 
-    // AJAX function for retrieving the tree data.
-    $.getJSON(phylotreeDataURL, function(treeData) {
-      displayData(treeData);
-      $('.phylogram-ajax-loader').hide();
+  // Creates the tree using the d3.phylogram.js library.
+  function phylogeny_display_data(treeData) {
+    var height = phylogeny_graph_height(treeData);
+    var tree_options = Drupal.settings.tripal_chado.tree_options;
+    d3.phylogram.build('#phylogram', treeData, {
+      'width' : tree_options['phylogram_width'],
+      'height' : height,
+      'fill' : phylogeny_organism_color,
+      'size' : phylogeny_node_size,
+      'nodeMouseOver' : phylogeny_node_mouse_over,
+      'nodeMouseOut' : phylogeny_node_mouse_out,
+      'nodeMouseDown' : phylogeny_node_mouse_down,
+      'skipTicks' : tree_options['skipTicks']
     });
+  }
 
-    // Creates the tree using the d3.phylogram.js library.
-    function displayData(treeData) {
-      height = graphHeight(treeData);
-      d3.phylogram.build('#phylogram', treeData, {
-        'width' : treeOptions['phylogram_width'],
-        'height' : height,
-        'fill' : organismColor,
-        'size' : nodeSize,
-        'nodeMouseOver' : nodeMouseOver,
-        'nodeMouseOut' : nodeMouseOut,
-        'nodeMouseDown' : nodeMouseDown,
-        'skipTicks' : treeOptions['skipTicks']
-      });
-    }
-
-    /* graphHeight() generate graph height based on leaf nodes */
-    function graphHeight(data) {
-      function countLeafNodes(node) {
-        if(! node.children) {
-          return 1;
-        }
-        var ct = 0;
-        node.children.forEach( function(child) {
-          ct+= countLeafNodes(child);
-        });
-        return ct;
+  /* graphHeight() generate graph height based on leaf nodes */
+  function phylogeny_graph_height(data) {
+    function count_leaf_nodes(node) {
+      if(! node.children) {
+        return 1;
       }
-      var leafNodeCt = countLeafNodes(data);
-      return 22 * leafNodeCt;
+      var ct = 0;
+      node.children.forEach( function(child) {
+        ct+= count_leaf_nodes(child);
+      });
+      return ct;
     }
-  });
-})(jQuery);
+    var leafNodeCt = count_leaf_nodes(data);
+    return 22 * leafNodeCt;
+  }
+})(jQuery);

+ 1 - 1
legacy/tripal_project/tripal_project.views_default.inc

@@ -35,7 +35,7 @@ function tripal_project_views_default_views() {
 function tripal_project_defaultvalue_user_projects() {
 
   // As a shortcut, currently I am copying the admin view and then tweaking it
-  // In thie future this should be replaced by a views export
+  // In the future this should be replaced by a views export
   $view = tripal_project_defaultview_admin_projects();
 
   // change some view admin stuff

+ 1 - 1
legacy/tripal_pub/includes/tripal_pub.admin.inc

@@ -127,7 +127,7 @@ function tripal_pub_admin() {
     '#type' => 'select',
     '#title' => t('Publication Type'),
     '#options' => $pub_types,
-    '#description' => t('Please set a default publiation type used for manual entry of a new
+    '#description' => t('Please set a default publication type used for manual entry of a new
       publication.  This is useful in the event that someone is manually adding the same
       publication type repetitively'),
     '#default_value' => $d_type_id,

+ 1 - 1
legacy/tripal_pub/includes/tripal_pub.chado_node.inc

@@ -1270,7 +1270,7 @@ function tripal_pub_node_presave($node) {
     case 'chado_pub':
       // when syncing the details are not present in the $node object
       // as they are when submitted via the form.  Therefore, if we do
-      // not see any field values from the form, we assume this fucntion
+      // not see any field values from the form, we assume this function
       // is being called for syncing, so we must set the title accordingly
       if (property_exists($node, 'title')) {
         // do nothing, the title is set

+ 1 - 1
legacy/tripal_stock/tripal_stock.module

@@ -320,7 +320,7 @@ function tripal_stock_match_stocks_page($id) {
   if (!$url_alias) {
     $url_alias = '/stock/[genus]/[species]/[type]/[uniquename]';
   }
-  $url_alias = preg_replace('/^\//', '', $url_alias); // remove any preceeding forward slash
+  $url_alias = preg_replace('/^\//', '', $url_alias); // remove any preceding forward slash
   if (preg_match('/^stock\//', $url_alias)) {
     drupal_goto($id);
   }

+ 1 - 1
legacy/tripal_stock/tripal_stock.views_default.inc

@@ -35,7 +35,7 @@ function tripal_stock_views_default_views() {
 function tripal_stock_defaultvalue_user_stocks() {
 
   // As a shortcut, currently I am copying the admin view and then tweaking it
-  // In thie future this should be replaced by a views export
+  // In the future this should be replaced by a views export
   $view = tripal_stock_defaultview_admin_stocks();
 
   // change some view admin stuff

+ 4 - 4
tripal/includes/TripalBundleController.inc

@@ -191,18 +191,18 @@ class TripalBundleController extends EntityAPIControllerExportable {
       $response = 0;
     }
     else {
-      $response = "";
+      $response = [];
     }
     while (($bundle_record = $results->fetchObject())) {
       $bid = $bundle_record->id;
       $bundle_response = $this->findOrphans($bid, $count, $offset, $limit);
       if (is_array($bundle_response)) {
         foreach ($bundle_response as $key => $value) {
-          $response += $value;
+          $response[] = $value;
         }
       }
       else {
-        $response += $bundle_response;
+        $response[] = $bundle_response;
       }
     }
     return $response;
@@ -257,7 +257,7 @@ class TripalBundleController extends EntityAPIControllerExportable {
       $bundle = tripal_load_bundle_entity(['id' => $id]);
       $response = module_invoke_all('bundle_delete_orphans', $bundle, $eids, $job);
 
-      // Now remove the entities. 
+      // Now remove the entities.
       $num_deleted = db_delete('tripal_entity')
         ->condition('id', $eids, 'IN')
         ->execute();

+ 2 - 2
tripal/includes/TripalEntityCollection.inc

@@ -262,7 +262,7 @@ class TripalEntityCollection {
    *
    * @return
    *   An associative array where the key is the TripalFieldDownloader class
-   *   name and the value is the human-readable lable for the formatter.
+   *   name and the value is the human-readable label for the formatter.
    */
   private function setFormatters() {
 
@@ -301,7 +301,7 @@ class TripalEntityCollection {
    *
    * @return
    *   An associative array where the key is the TripalFieldDownloader class
-   *   name and the value is the human-readable lable for the formatter.
+   *   name and the value is the human-readable label for the formatter.
    */
   public function getFormatters() {
     return $this->formatters;

+ 47 - 3
tripal/includes/TripalEntityController.inc

@@ -58,7 +58,7 @@ class TripalEntityController extends EntityAPIController {
   }
 
   /**
-   * Overrides EntityAPIController::delete().
+   * Provides an unpublish function.
    *
    * @param array $ids
    *    An array of the ids denoting which entities to delete.
@@ -66,7 +66,7 @@ class TripalEntityController extends EntityAPIController {
    *    Optionally a DatabaseTransaction object to use. Allows overrides to
    *   pass in their transaction object.
    */
-  public function delete($ids, $transaction = NULL) {
+  public function unpublish($ids, $transaction = NULL) {
 
     if (!$transaction) {
       $transaction = db_transaction();
@@ -80,7 +80,7 @@ class TripalEntityController extends EntityAPIController {
       foreach ($entities as $entity) {
 
         // Invoke hook_entity_delete().
-        module_invoke_all('entity_delete', $entity, $entity->type);
+        module_invoke_all('entity_unpublish', $entity, $entity->type);
 
         // Delete any field data for this entity.
         field_attach_delete('TripalEntity', $entity);
@@ -102,6 +102,50 @@ class TripalEntityController extends EntityAPIController {
     return TRUE;
   }
 
+  /**
+   * Overrides EntityAPIController::delete().
+   *
+   * @param array $ids
+   *    An array of the ids denoting which entities to delete.
+   * @param DatabaseTransaction $transaction
+   *    Optionally a DatabaseTransaction object to use. Allows overrides to
+   *   pass in their transaction object.
+   */
+  public function delete($ids, $transaction = NULL) {
+    global $user;
+
+    // Next delete the entities
+    if (!$transaction) {
+      $transaction = db_transaction();
+    }
+
+    try {
+
+      // First load the entity.
+      $entities = entity_load('TripalEntity', $ids);
+      $this->unpublish($ids, $transaction);
+
+      // Then properly delete each one.
+      foreach ($entities as $entity) {
+        module_invoke_all('entity_delete', $entity, $entity->type);
+      }
+
+    } catch (Exception $e) {
+      if ($transaction) {
+        $transaction->rollback();
+      }
+      watchdog_exception('tripal', $e);
+      throw $e;
+      return FALSE;
+    }
+
+    // Now remove any orphaned entities
+    tripal_add_job('Delete Orphaned Entities', 'tripal_chado',
+        'tripal_unpublish_orphans', [0], $user->uid, 10, [], TRUE);
+
+    return TRUE;
+  }
+
   /**
    * Sets the title for an entity.
    *

+ 90 - 18
tripal/includes/TripalEntityUIController.inc

@@ -100,7 +100,15 @@ class TripalEntityUIController extends EntityDefaultUIController {
       'type' => MENU_LOCAL_TASK,
       'weight' => 10,
     ];
-    // Menu item for deleting tripal data entities.
+    $items['bio_data/' . $wildcard . '/unpublish'] = [
+      'title' => 'Unpublish',
+      'page callback' => 'drupal_get_form',
+      'page arguments' => ['tripal_entity_unpublish_form', 1],
+      'access callback' => 'tripal_entity_access',
+      'access arguments' => ['unpublish', 1],
+      'type' => MENU_CALLBACK,
+      'weight' => 11,
+    ];
     $items['bio_data/' . $wildcard . '/delete'] = [
       'title' => 'Delete',
       'page callback' => 'drupal_get_form',
@@ -108,7 +116,7 @@ class TripalEntityUIController extends EntityDefaultUIController {
       'access callback' => 'tripal_entity_access',
       'access arguments' => ['delete', 1],
       'type' => MENU_CALLBACK,
-      'weight' => 10,
+      'weight' => 12,
     ];
     return $items;
   }
@@ -393,8 +401,8 @@ function tripal_content_overview_form($form, &$form_state) {
     if (entity_access('edit', 'TripalEntity', $entity, $user)) {
       $links .= '&nbsp;&nbsp;' . l('edit', 'bio_data/' . $entity->id . '/edit');
     }
-    if (entity_access('delete', 'TripalEntity', $entity, $user)) {
-      $links .= '&nbsp;&nbsp;' . l('delete', 'bio_data/' . $entity->id . '/delete');
+    if (entity_access('unpublish', 'TripalEntity', $entity, $user)) {
+      $links .= '&nbsp;&nbsp;' . l('unpublish', 'bio_data/' . $entity->id . '/unpublish');
     }
 
     // Add information to the table.
@@ -530,15 +538,24 @@ function tripal_entity_form($form, &$form_state, $term_id = '', $entity = NULL)
       '#weight' => 1000,
     ];
 
+    if (entity_access('unpublish', 'TripalEntity', $entity, $user)) {
+      $form['unpublish_button'] = [
+        '#type' => 'submit',
+        '#value' => t('Unpublish'),
+        '#name' => 'unpublish_data',
+        '#weight' => 1002,
+        '#attributes' => ['style' => 'float: right'],
+      ];
+    }
     // Put the delete button on the far-right so that it's harder
     // to accidentally click it.
     if (entity_access('delete', 'TripalEntity', $entity, $user)) {
       $form['delete_button'] = [
-        '#type' => 'submit',
-        '#value' => t('Delete'),
-        '#name' => 'delete_data',
-        '#weight' => 1002,
-        '#attributes' => ['style' => 'float: right'],
+          '#type' => 'submit',
+          '#value' => t('Delete'),
+          '#name' => 'delete_data',
+          '#weight' => 1003,
+          '#attributes' => ['style' => 'float: right'],
       ];
     }
   }
@@ -677,6 +694,7 @@ function tripal_entity_form_validate($form, &$form_state) {
  */
 function tripal_entity_form_submit($form, &$form_state) {
   $entity = $form_state['TripalEntity'];
+  global $user;
 
   if ($form_state['clicked_button']['#name'] == 'cancel_data') {
     if (property_exists($entity, 'id')) {
@@ -689,7 +707,15 @@ function tripal_entity_form_submit($form, &$form_state) {
   }
 
   if ($form_state['clicked_button']['#name'] == 'delete_data') {
-    $form_state['redirect'] = 'bio_data/' . $entity->id . '/delete';
+    if (entity_access('delete', 'TripalEntity', $entity, $user)) {
+      $form_state['redirect'] = 'bio_data/' . $entity->id . '/delete';
+    }
+    return;
+  }
+  if ($form_state['clicked_button']['#name'] == 'unpublish_data') {
+    if (entity_access('unpublish', 'TripalEntity', $entity, $user)) {
+      $form_state['redirect'] = 'bio_data/' . $entity->id . '/unpublish';
+    }
     return;
   }
 
@@ -876,11 +902,56 @@ function theme_tripal_add_list($variables) {
   return $output;
 }
 
+/**
+ * Form callback: confirmation form for unpublishing a tripal_entity.
+ *
+ * @param $tripal_entity
+ *   The tripal_entity to delete
+ *
+ * @see confirm_form()
+ */
+function tripal_entity_unpublish_form($form, &$form_state, $entity) {
+  $form_state['entity'] = $entity;
+  $form['#submit'][] = 'tripal_entity_unpublish_form_submit';
+
+  $form = confirm_form($form,
+    t('Unpublish the record "%title"?  This will delete the Drupal record, but not the underlying (eg Chado) record.',
+      ['%title' => $entity->title]), 'admin/content/bio_data',
+    '<p>' . t('This action cannot be undone.') . '</p>',
+      t('Yes, Unpublish'), t('No, Cancel'), 'confirm');
+
+  return $form;
+}
+
+/**
+ * Submit callback for tripal_entity_unpublish_form
+ */
+function tripal_entity_unpublish_form_submit($form, &$form_state) {
+  global $user;
+  $entity = $form_state['entity'];
+
+  if (!entity_access('unpublish', 'TripalEntity', $entity, $user)) {
+    drupal_set_message(t('You do not have permission to unpublish this content.'), "error");
+    $form_state['redirect'] = 'admin/content/bio_data';
+    return;
+  }
+
+  $entity_controller = new TripalEntityController($entity->type);
+
+  if ($entity_controller->unpublish([$entity->id])) {
+    drupal_set_message(t('The record "%name" has been unpublished. The record, however, remains in the database and you can republish it later.', ['%name' => $entity->title]));
+    $form_state['redirect'] = 'admin/content/bio_data';
+  }
+  else {
+    drupal_set_message(t('The record "%name" was not unpublished.', ['%name' => $entity->title]), "error");
+  }
+}
+
 /**
  * Form callback: confirmation form for deleting a tripal_entity.
  *
- * @param $tripal_entity The
- *          tripal_entity to delete
+ * @param $tripal_entity
+ *   The tripal_entity to delete
  *
  * @see confirm_form()
  */
@@ -889,15 +960,15 @@ function tripal_entity_delete_form($form, &$form_state, $entity) {
   $form['#submit'][] = 'tripal_entity_delete_form_submit';
 
   $form = confirm_form($form,
-    t('Click the delete button below to confirm deletion of the record titled: %title',
-      ['%title' => $entity->title]), 'admin/content/tripal_entity',
-    '<p>' . t('This action cannot be undone.') . '</p>', t('Delete'), t('Cancel'), 'confirm');
+      t('Delete the record "%title"?',
+          ['%title' => $entity->title]), 'admin/content/bio_data',
+      '<p>' . t('This action cannot be undone. It will result in this record being unpublished and completely removed from the database. Any downstream records that depend on this entry will also be unpublished and completely removed as well. Please delete with caution!') . '</p>', t('Yes, Delete'), t('No, Cancel'), 'confirm');
 
   return $form;
 }
 
 /**
- * Submit callback for tripal_entity_delete_form
+ * Submit callback for tripal_entity_unpublish_form
  */
 function tripal_entity_delete_form_submit($form, &$form_state) {
   global $user;
@@ -912,11 +983,12 @@ function tripal_entity_delete_form_submit($form, &$form_state) {
   $entity_controller = new TripalEntityController($entity->type);
 
   if ($entity_controller->delete([$entity->id])) {
-    drupal_set_message(t('The record title "%name" has been deleted.', ['%name' => $entity->title]));
+    drupal_set_message(t('The record "%name" was deleted along with any dependent, downstream records.  Deleted records are no longer in the database. However, the site may still have published records. Therefore, a job has been added to remove any published but orphaned records.', ['%name' => $entity->title]));
     $form_state['redirect'] = 'admin/content/bio_data';
   }
   else {
-    drupal_set_message(t('The tripal_entity %name was not deleted.', ['%name' => $entity->title]), "error");
+    drupal_set_message(t('The record "%name" was not deleted.', ['%name' => $entity->title]), "error");
+    $form_state['redirect'] = 'admin/content/bio_data';
   }
 }
 

+ 5 - 5
tripal/includes/TripalFields/TripalField.inc

@@ -11,7 +11,7 @@ class TripalField {
   // the field and it's default widget and formatter.
   // --------------------------------------------------------------------------
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Tripal Field';
 
   // The default description for this field.
@@ -33,15 +33,15 @@ class TripalField {
     'searchable_keys' => [],
   ];
 
-  // Provide a list of instance specific settings. These can be access within
+  // Provide a list of instance specific settings. These can be accessed within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
-  // then Drupal with automatically change these settings for the instnace.
+  // then Drupal will automatically change these settings for the instance.
   // It is recommended to put settings at the instance level whenever possible.
   // If you override this variable in a child class be sure to replicate the
   // term_name, term_vocab, term_accession and term_fixed keys as these are
   // required for all TripalFields.
   public static $default_instance_settings = [
-    // The short name for the vocabulary (e.g. shcema, SO, GO, PATO, etc.).
+    // The short name for the vocabulary (e.g. schema, SO, GO, PATO, etc.).
     'term_vocabulary' => 'schema',
     // The name of the term.
     'term_name' => 'Thing',
@@ -518,7 +518,7 @@ class TripalField {
    * The value of this top-level key is an array with the following keys:
    *   -name: this key is not actually used but is availble to improve
    *     readability of the array.  Because the key is a vocabulary term
-   *     conaining only the accession it's not always clear what it means.
+   *     containing only the accession it's not always clear what it means.
    *     Providing a 'name' key helps other's know what the term is.
    *   -searchable:  TRUE if the element can be used for filtering the content
    *     type to which tis field is attached.  FALSE if not.

+ 1 - 1
tripal/includes/TripalFields/TripalFieldFormatter.inc

@@ -3,7 +3,7 @@
 class TripalFieldFormatter {
 
   /**
-   * The default lable for this field.
+   * The default label for this field.
    */
   public static $default_label = 'Tripal Field.';
 

+ 2 - 2
tripal/includes/TripalFields/TripalFieldWidget.inc

@@ -2,7 +2,7 @@
 
 class TripalFieldWidget {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Tripal Field.';
 
   // The list of field types for which this formatter is appropriate.
@@ -158,7 +158,7 @@ class TripalFieldWidget {
    * on other tables not directly associated with the field.
    *
    * An example is the chado.feature_synonym table.  The chado_linker__synonym
-   * field allows the user to provide a brand new synonynm and it must add it
+   * field allows the user to provide a brand new synonym and it must add it
    * to the chado.synonym table prior to the record in the
    * chado.feature_synonym table.  This insert occurs in the widgetFormSubmit
    * function.

+ 1 - 1
tripal/includes/TripalFields/content_type/content_type.inc

@@ -2,7 +2,7 @@
 
 class content_type extends TripalField {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Content Type';
 
   // The default description for this field.

+ 4 - 4
tripal/includes/TripalFields/rdfs__type/rdfs__type.inc

@@ -2,7 +2,7 @@
 
 class rdfs__type extends TripalField {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Content Type';
 
   // The default description for this field.
@@ -13,15 +13,15 @@ class rdfs__type extends TripalField {
   // Drupal will automatically change these settings for all fields.
   public static $default_settings = [];
 
-  // Provide a list of instance specific settings. These can be access within
+  // Provide a list of instance specific settings. These can be accessed within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
-  // then Drupal with automatically change these settings for the instnace.
+  // then Drupal will automatically change these settings for the instance.
   // It is recommended to put settings at the instance level whenever possible.
   // If you override this variable in a child class be sure to replicate the
   // term_name, term_vocab, term_accession and term_fixed keys as these are
   // required for all TripalFields.
   public static $default_instance_settings = [
-    // The short name for the vocabulary (e.g. shcema, SO, GO, PATO, etc.).
+    // The short name for the vocabulary (e.g. schema, SO, GO, PATO, etc.).
     'term_vocabulary' => 'rdfs',
     // The name of the term.
     'term_name' => 'type',

+ 1 - 1
tripal/includes/TripalFields/rdfs__type/rdfs__type_formatter.inc

@@ -2,7 +2,7 @@
 
 class rdfs__type_formatter extends TripalFieldFormatter {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Content Type';
 
   // The list of field types for which this formatter is appropriate.

+ 1 - 1
tripal/includes/TripalFields/rdfs__type/rdfs__type_widget.inc

@@ -2,7 +2,7 @@
 
 class rdfs__type_widget extends TripalFieldWidget {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Content Type';
 
   // The list of field types for which this formatter is appropriate.

+ 3 - 3
tripal/includes/TripalImporter.inc

@@ -47,7 +47,7 @@ class TripalImporter {
 
   /**
    * If the loader should require an analysis record.  To maintain provenance
-   * we should always indiate where the data we are uploading comes from.
+   * we should always indicate where the data we are uploading comes from.
    * The method that Tripal attempts to use for this by associating upload files
    * with an analysis record.  The analysis record provides the details for
    * how the file was created or obtained. Set this to FALSE if the loader
@@ -108,7 +108,7 @@ class TripalImporter {
 
   /**
    * Be default, all loaders are automaticlly added to the Admin >
-   * Tripal > Data Laders menu.  However, if this loader should be
+   * Tripal > Data Loaders menu.  However, if this loader should be
    * made available via a different menu path, then set it here.  If the
    * value is empty then the path will be the default.
    */
@@ -276,7 +276,7 @@ class TripalImporter {
    * to the job log.
    *
    * @param TripalJob $job
-   *   An instnace of a TripalJob.
+   *   An instance of a TripalJob.
    */
   public function setJob(TripalJob $job) {
     $this->job = $job;

+ 3 - 1
tripal/includes/tripal.entity.inc

@@ -428,7 +428,7 @@ function tripal_field_property_get($entity, array $options, $field_name, $entity
  * tripal_entity_info() under the 'access callback' element.
  *
  * @param $op
- *   The operation. One of: create, view, edit, delete.
+ *   The operation. One of: create, view, edit, unpublish, delete.
  * @param $entity
  *   The entity to check access for.
  * @param $account
@@ -495,6 +495,8 @@ function tripal_entity_access($op, $entity = NULL, $account = NULL, $entity_type
       return user_access('view ' . $bundle_name, $account);
     case 'edit':
       return user_access('edit ' . $bundle_name, $account);
+    case 'unpublish':
+      return user_access('unpublish ' . $bundle_name, $account);
     case 'delete':
       return user_access('delete ' . $bundle_name, $account);
   }

+ 1 - 1
tripal/includes/tripal.field_storage.inc

@@ -49,7 +49,7 @@ function tripal_field_storage_load($entity_type, $entities, $age,
       $field_type = $field['type'];
       $field_module = $field['module'];
 
-      // Get the instnace for this field
+      // Get the instance for this field
       $instance = field_info_instance($entity_type, $field_name, $entity->bundle);
 
       // Allow the creating module to alter the value if desired.  The

+ 6 - 1
tripal/tripal.module

@@ -763,9 +763,13 @@ function tripal_permission() {
       'description' => t('Allow the user to edit %label content', array('%label' => $bundle->label)),
       'restrict access' => TRUE,
     );
+    $permissions['unpublish ' . $bundle->name] = array(
+      'title' => t('%label: Unpublish Content', array('%label' => $bundle->label)),
+      'description' => t('Allow the user to unpublish %label content. Unpublishing of content removes it from visibility on the site but does not delete the record in the underlying database.', array('%label' => $bundle->label)),
+    );
     $permissions['delete ' . $bundle->name] = array(
       'title' => t('%label: Delete Content', array('%label' => $bundle->label)),
-      'description' => t('Allow the user to delete %label content', array('%label' => $bundle->label)),
+      'description' => t('Allow the user to delete %label content. When content is deleted it is first unpublished and then deleted from the database.', array('%label' => $bundle->label)),
       'restrict access' => TRUE,
     );
   }
@@ -868,6 +872,7 @@ function tripal_admin_paths() {
     $paths = array(
       'bio_data/*/edit' => TRUE,
       'bio_data/*/delete' => TRUE,
+      'bio_data/*/unpublish' => TRUE,
       'bio_data/add' => TRUE,
       'bio_data/add/*' => TRUE,
     );

+ 4 - 4
tripal/tripal_views_query.inc

@@ -112,7 +112,7 @@ class tripal_views_query extends views_plugin_query {
       // For fields compatible with the Tripal storage API, the
       // incoming $field_name is a combination of the entity term ID,
       // followed by the field name and the the sub element string, with
-      // sub elements children separated by a comma.  For non Tripal 
+      // sub elements children separated by a period.  For non Tripal
       // storage API the $field_name is a combination of the table name
       // followed by the table column.  We have to handle both because
       // a TripalEntity can have both types attached.
@@ -121,8 +121,8 @@ class tripal_views_query extends views_plugin_query {
       if (count($elements) > 2) {
         $bundle_term = array_shift($elements);
         $field_name = array_shift($elements);
-        // put the sub elements back together into a string with a 
-        // comma delimeter.
+        $field = field_info_field($field_name);
+        // put the sub elements back together into a string with a comma.
         $element_name = implode(',', $elements);
       }
       if (count($elements) == 2) {
@@ -146,7 +146,7 @@ class tripal_views_query extends views_plugin_query {
         // Construct the field term.
         $field_term = $instance['settings']['term_vocabulary'] . ':' . $instance['settings']['term_accession'];
 
-        // Let's add add on the $field_term to the element_name and add the
+        // Let's add on the $field_term to the element_name and add the
         // query condition.
         if ($element_name) {
           $element_name = $field_term . ',' . $element_name;

+ 1 - 1
tripal/views_handlers/tripal_views_handler_filter_select_string.inc

@@ -142,7 +142,7 @@ class tripal_views_handler_filter_string_selectbox extends views_handler_filter_
     $placeholder_prefix = 'arg';
     $i = 0;
     foreach ($filters as $filter_name => $details) {
-      // we only want to inclue non-exposed filters
+      // we only want to include non-exposed filters
       if ($details->options['exposed'] == FALSE) {
         $i++;
 

+ 1 - 1
tripal_bulk_loader/api/tripal_bulk_loader.api.templates.inc

@@ -38,7 +38,7 @@
  *   value is the error message.
  *
  * @return
- *   If validation failes then FALSE is returned.  Any options that do not pass
+ *   If validation fails then FALSE is returned.  Any options that do not pass
  *   validation checks will be added in the $errors array with the key being
  *   the option and the value being the error message.  If validation
  *   is successful then TRUE is returned.

+ 2 - 2
tripal_chado/api/modules/tripal_chado.analysis.api.inc

@@ -1,7 +1,7 @@
 <?php
 /**
  * @file
- * Provides API functions specificially for managing analysis records in Chado.
+ * Provides API functions specifically for managing analysis records in Chado.
  *
  * @ingroup tripal_chado
  */
@@ -19,7 +19,7 @@
 /**
  * Retrieves a chado analysis variable.
  *
- * @param $itentifier
+ * @param $identifier
  *   an array with the key stating what the identifier is. Supported keys
  *   (only on of the following unique keys is required):
  *    - analysis_id: the chado analysis.analysis_id primary key.

+ 1 - 1
tripal_chado/api/modules/tripal_chado.contact.api.inc

@@ -1,7 +1,7 @@
 <?php
 /**
  * @file
- * Provides API functions specificially for managing contact records in Chado.
+ * Provides API functions specifically for managing contact records in Chado.
  *
  * @ingroup tripal_chado
  */

+ 2 - 2
tripal_chado/api/modules/tripal_chado.cv.api.inc

@@ -1,7 +1,7 @@
 <?php
 /**
  * @file
- * Provides API functions specificially for managing controlled vocabulary
+ * Provides API functions specifically for managing controlled vocabulary
  * records in Chado.
  *
  * @ingroup tripal_chado
@@ -11,7 +11,7 @@
  * @defgroup tripal_chado_cv_api Chado CV
  * @ingroup tripal_chado_api
  * @{
- * Provides API functions specificially for managing controlled vocabulary
+ * Provides API functions specifically for managing controlled vocabulary
  * records in Chado. Please note that Tripal v3 provides a generic set of
  * API functions for working with controlled vocabularies (CVs). This allows for
  * CVs to be stored using any back-end.  By default CV's continue to be housed

+ 1 - 1
tripal_chado/api/modules/tripal_chado.db.api.inc

@@ -1,7 +1,7 @@
 <?php
 /**
  * @file
- * Provides API functions specificially for managing external database reference
+ * Provides API functions specifically for managing external database reference
  * records in Chado.
  */
 

+ 5 - 5
tripal_chado/api/modules/tripal_chado.feature.api.inc

@@ -1,7 +1,7 @@
 <?php
 /**
  * @file
- * Provides API functions specificially for managing feature
+ * Provides API functions specifically for managing feature
  * records in Chado.
  */
 
@@ -9,7 +9,7 @@
  * @defgroup tripal_feature_api Chado Feature
  * @ingroup tripal_chado_api
  * @{
- * Provides API functions specificially for managing feature
+ * Provides API functions specifically for managing feature
  * records in Chado especially retrieving relationships and sequences derived
  * from relationships and feature alignments.
  * @}
@@ -120,7 +120,7 @@ function chado_reverse_compliment_sequence($sequence) {
  *   sequence_of)
  *      then any sequences that are in relationships of this type with matched
  *      sequences are also included.
- *    - relationship_part: If a relationship is provided in the preceeding
+ *    - relationship_part: If a relationship is provided in the preceding
  *      argument then the rel_part must be either 'object' or 'subject' to
  *      indicate which side of the relationship the matched features belong.
  *
@@ -435,7 +435,7 @@ function chado_get_feature_sequences($feature, $options) {
           }
 
           // Next, if the last sub feature we need to include the downstream
-          // bases. First check if the feature is in teh forward direction or
+          // bases. First check if the feature is in the forward direction or
           // the reverse.
           elseif ($i == $num_children - 1 and $parent->strand >= 0) {  // forward direction
             // -------------------------- ref
@@ -609,7 +609,7 @@ function chado_get_feature_sequences($feature, $options) {
  *   sequence_of)
  *      then any sequences that are in relationships of this type with matched
  *      sequences are also included
- *    - relationship_part: If a relationship is provided in the preceeding
+ *    - relationship_part: If a relationship is provided in the preceding
  *      argument then the rel_part must be either 'object' or 'subject' to
  *      indicate which side of the relationship the matched features belong
  *    - width: Indicate the number of bases to use per line.  A new line will

+ 6 - 6
tripal_chado/api/modules/tripal_chado.module.DEPRECATED.api.inc

@@ -20,7 +20,7 @@
 /**
  * Retrieves a chado analysis variable.
  *
- * @param $itentifier
+ * @param $identifier
  *   an array with the key stating what the identifier is. Supported keys
  *   (only on of the following unique keys is required):
  *    - analysis_id: the chado analysis.analysis_id primary key.
@@ -726,7 +726,7 @@ function tripal_reverse_compliment_sequence($sequence) {
  *   sequence_of)
  *      then any sequences that are in relationships of this type with matched
  *      sequences are also included.
- *    - relationship_part: If a relationship is provided in the preceeding
+ *    - relationship_part: If a relationship is provided in the preceding
  *      argument then the rel_part must be either 'object' or 'subject' to
  *      indicate which side of the relationship the matched features belong.
  *
@@ -782,7 +782,7 @@ function tripal_get_feature_sequences($feature, $options) {
  *   sequence_of)
  *      then any sequences that are in relationships of this type with matched
  *      sequences are also included
- *    - relationship_part: If a relationship is provided in the preceeding
+ *    - relationship_part: If a relationship is provided in the preceding
  *      argument then the rel_part must be either 'object' or 'subject' to
  *      indicate which side of the relationship the matched features belong
  *    - width: Indicate the number of bases to use per line.  A new line will
@@ -995,7 +995,7 @@ function tripal_abbreviate_infraspecific_rank($rank) {
  *   value is the error message.
  *
  * @return
- *   If validation failes then FALSE is returned.  Any options that do not pass
+ *   If validation fails then FALSE is returned.  Any options that do not pass
  *   validation checks will be added in the $errors array with the key being
  *   the option and the value being the error message.  If validation
  *   is successful then TRUE is returned.
@@ -1166,7 +1166,7 @@ function tripal_assign_phylogeny_tree_indices(&$tree, &$index = 1) {
  *   -organism_id:  The organism_id for associtating the node with an organism.
  *   -properties:   An array of key/value pairs where the key is the cvterm_id
  *                  and the value is the property value.  These properties
- *                  will be assocaited with the phylonode.
+ *                  will be associated with the phylonode.
  *
  * Prior to importing the tree the indicies can be set by using the
  * chado_assign_phylogeny_tree_indices() function.
@@ -1292,7 +1292,7 @@ function tripal_get_publication($identifiers, $options = []) {
 
 /**
  * The publication table of Chado only has a unique constraint for the
- * uniquename of the publiation, but in reality a publication can be considered
+ * uniquename of the publication, but in reality a publication can be considered
  * unique by a combination of the title, publication type, published year and
  * series name (e.g. journal name or conference name). The site administrator
  * can configure how publications are determined to be unique.  This function

+ 2 - 2
tripal_chado/api/modules/tripal_chado.organism.api.inc

@@ -1,7 +1,7 @@
 <?php
 /**
  * @file
- * Provides API functions specificially for managing feature
+ * Provides API functions specifically for managing feature
  * records in Chado.
  */
 
@@ -9,7 +9,7 @@
  * @defgroup tripal_organism_api Chado Organism
  * @ingroup tripal_chado_api
  * @{
- * Provides API functions specificially for managing organism
+ * Provides API functions specifically for managing organism
  * records in Chado.
  * @}
  */

+ 5 - 5
tripal_chado/api/modules/tripal_chado.phylotree.api.inc

@@ -2,7 +2,7 @@
 
 /**
  * @file
- * Provides API functions specificially for managing phylogenetic and taxonomic
+ * Provides API functions specifically for managing phylogenetic and taxonomic
  * tree records in Chado.
  */
 
@@ -10,7 +10,7 @@
  * @defgroup tripal_phylotree_api Chado Phylotree
  * @ingroup tripal_chado_api
  * @{
- * Provides API functions specificially for managing phylogenetic and taxonomic
+ * Provides API functions specifically for managing phylogenetic and taxonomic
  * tree records in Chado.  The API consists of functions for creation,
  * retrieval, update and deltion (CRUD) for phylogenetic tree records as
  * well as importing of trees in the newick file format.
@@ -44,7 +44,7 @@
  *   value is the error message.
  *
  * @return
- *   If validation failes then FALSE is returned.  Any options that do not pass
+ *   If validation fails then FALSE is returned.  Any options that do not pass
  *   validation checks will be added in the $errors array with the key being
  *   the option and the value being the error message.  If validation
  *   is successful then TRUE is returned.
@@ -619,7 +619,7 @@ function chado_assign_phylogeny_tree_indices(&$tree, &$index = 1) {
  *   -organism_id:  The organism_id for associtating the node with an organism.
  *   -properties:   An array of key/value pairs where the key is the cvterm_id
  *                  and the value is the property value.  These properties
- *                  will be assocaited with the phylonode.
+ *                  will be associated with the phylonode.
  *
  * Prior to importing the tree the indicies can be set by using the
  * chado_assign_phylogeny_tree_indices() function.
@@ -745,7 +745,7 @@ function chado_phylogeny_import_tree(&$tree, $phylotree, $options, $vocab = [],
     $phylonode = chado_insert_record('phylonode', $values);
     $tree['phylonode_id'] = $phylonode['phylonode_id'];
 
-    // This is a taxonomic tree, so assocaite this node with an
+    // This is a taxonomic tree, so associate this node with an
     // organism if one is provided.
     if (array_key_exists('organism_id', $tree)) {
       $values = [

+ 2 - 2
tripal_chado/api/modules/tripal_chado.project.api.inc

@@ -1,7 +1,7 @@
 <?php
 /**
  * @file
- * Provides API functions specificially for managing project
+ * Provides API functions specifically for managing project
  * records in Chado.
  */
 
@@ -9,7 +9,7 @@
  * @defgroup tripal_project_api Chado Project
  * @ingroup tripal_chado_api
  * @{
- * Provides API functions specificially for managing project
+ * Provides API functions specifically for managing project
  * records in Chado.  The project table of Chado is used for storing a variety
  * of data types besides just projects from a project collection.  Examples of
  * other records commonly stored in the project table are germplasm and

+ 3 - 3
tripal_chado/api/modules/tripal_chado.pub.api.inc

@@ -1,7 +1,7 @@
 <?php
 /**
  * @file
- * Provides API functions specificially for managing publication
+ * Provides API functions specifically for managing publication
  * records in Chado.
  */
 
@@ -9,7 +9,7 @@
  * @defgroup tripal_pub_api Chado Publication
  * @ingroup tripal_chado_api
  * @{
- * Provides API functions specificially for managing publication
+ * Provides API functions specifically for managing publication
  * records in Chado.
  * @}
  */
@@ -156,7 +156,7 @@ function chado_get_publication($identifiers, $options = []) {
 
 /**
  * The publication table of Chado only has a unique constraint for the
- * uniquename of the publiation, but in reality a publication can be considered
+ * uniquename of the publication, but in reality a publication can be considered
  * unique by a combination of the title, publication type, published year and
  * series name (e.g. journal name or conference name). The site administrator
  * can configure how publications are determined to be unique.  This function

+ 2 - 2
tripal_chado/api/modules/tripal_chado.stock.api.inc

@@ -1,7 +1,7 @@
 <?php
 /**
  * @file
- * Provides API functions specificially for managing stock
+ * Provides API functions specifically for managing stock
  * records in Chado.
  */
 
@@ -9,7 +9,7 @@
  * @defgroup tripal_stock_api Chado Stock
  * @ingroup tripal_chado_api
  * @{
- * Provides API functions specificially for managing stock
+ * Provides API functions specifically for managing stock
  * records in Chado.  The stock table of Chado is used for storing a variety
  * of data types besides just stocks from a stock collection.  Examples of
  * other records commonly stored in the stock table are germplasm and

+ 1 - 1
tripal_chado/api/tripal_chado.variables.api.inc

@@ -41,7 +41,7 @@
  *   $feature = chado_generate_var('feature', $values);
  * @endcode
  *
- * The $values array passed to this fucntion can be of the same format used
+ * The $values array passed to this function can be of the same format used
  * by the chado_select_record() function.
  *
  * If a field is a foreign key then its value is an object that contains

+ 210 - 210
tripal_chado/chado_schema/default_schema-1.2-1.3-diff.sql

@@ -3010,12 +3010,12 @@ NOT have the specified term.';
 -- Name: analysis_cvterm_analysis_cvterm_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE analysis_cvterm_analysis_cvterm_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS analysis_cvterm_analysis_cvterm_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 
 --
@@ -3057,12 +3057,12 @@ accessions should set this field to false';
 -- Name: analysis_dbxref_analysis_dbxref_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE analysis_dbxref_analysis_dbxref_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS analysis_dbxref_analysis_dbxref_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 
 --
@@ -3095,12 +3095,12 @@ COMMENT ON TABLE analysis_pub IS 'Provenance. Linking table between analyses and
 -- Name: analysis_pub_analysis_pub_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE analysis_pub_analysis_pub_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS analysis_pub_analysis_pub_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 
 
@@ -3171,12 +3171,12 @@ important where rank is used to order these; starts from zero.';
 -- Name: analysis_relationship_analysis_relationship_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE analysis_relationship_analysis_relationship_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS analysis_relationship_analysis_relationship_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 
 --
@@ -3492,12 +3492,12 @@ relational schema, and is completely extensible.';
 -- Name: contactprop_contactprop_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE contactprop_contactprop_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS contactprop_contactprop_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 
 --
@@ -3589,12 +3589,12 @@ the combination of db_id, rank, and type_id. Multivalued property-value pairs mu
 -- Name: dbprop_dbprop_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE dbprop_dbprop_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS dbprop_dbprop_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: dbprop_dbprop_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: chado
@@ -3747,12 +3747,12 @@ person or organization responsible for discovery or that can provide more inform
 -- Name: feature_contact_feature_contact_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE feature_contact_feature_contact_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS feature_contact_feature_contact_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: feature_contact_feature_contact_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: chado
@@ -3920,12 +3920,12 @@ that can provide more information on a particular featuremap.';
 -- Name: featuremap_contact_featuremap_contact_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE featuremap_contact_featuremap_contact_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS featuremap_contact_featuremap_contact_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: featuremap_contact_featuremap_contact_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: chado
@@ -3949,12 +3949,12 @@ CREATE TABLE IF NOT EXISTS featuremap_dbxref (
 -- Name: featuremap_dbxref_featuremap_dbxref_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE featuremap_dbxref_featuremap_dbxref_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS featuremap_dbxref_featuremap_dbxref_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: featuremap_dbxref_featuremap_dbxref_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: chado
@@ -3984,12 +3984,12 @@ COMMENT ON TABLE featuremap_organism IS 'Links a featuremap to the organism(s) w
 -- Name: featuremap_organism_featuremap_organism_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE featuremap_organism_featuremap_organism_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS featuremap_organism_featuremap_organism_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: featuremap_organism_featuremap_organism_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: chado
@@ -4031,12 +4031,12 @@ relational schema, and is completely extensible.';
 -- Name: featuremapprop_featuremapprop_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE featuremapprop_featuremapprop_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS featuremapprop_featuremapprop_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 
 --
@@ -4081,12 +4081,12 @@ COMMENT ON TABLE featureposprop IS 'Property or attribute of a featurepos record
 -- Name: featureposprop_featureposprop_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE featureposprop_featureposprop_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS featureposprop_featureposprop_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: featureposprop_featureposprop_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: chado
@@ -4171,12 +4171,12 @@ COMMENT ON TABLE library_contact IS 'Links contact(s) with a library.  Used to i
 -- Name: library_contact_library_contact_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE library_contact_library_contact_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS library_contact_library_contact_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: library_contact_library_contact_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: chado
@@ -4231,12 +4231,12 @@ COMMENT ON TABLE library_expression IS 'Links a library to expression statements
 -- Name: library_expression_library_expression_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE library_expression_library_expression_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS library_expression_library_expression_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: library_expression_library_expression_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: chado
@@ -4268,12 +4268,12 @@ COMMENT ON TABLE library_expressionprop IS 'Attributes of a library_expression r
 -- Name: library_expressionprop_library_expressionprop_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE library_expressionprop_library_expressionprop_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS library_expressionprop_library_expressionprop_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: library_expressionprop_library_expressionprop_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: chado
@@ -4313,12 +4313,12 @@ COMMENT ON TABLE library_featureprop IS 'Attributes of a library_feature relatio
 -- Name: library_featureprop_library_featureprop_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE library_featureprop_library_featureprop_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS library_featureprop_library_featureprop_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: library_featureprop_library_featureprop_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: chado
@@ -4364,12 +4364,12 @@ COMMENT ON TABLE library_relationship IS 'Relationships between libraries.';
 -- Name: library_relationship_library_relationship_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE library_relationship_library_relationship_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS library_relationship_library_relationship_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 
 --
@@ -4400,12 +4400,12 @@ COMMENT ON TABLE library_relationship_pub IS 'Provenance of library_relationship
 -- Name: library_relationship_pub_library_relationship_pub_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE library_relationship_pub_library_relationship_pub_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS library_relationship_pub_library_relationship_pub_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: library_relationship_pub_library_relationship_pub_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: chado
@@ -4518,12 +4518,12 @@ COMMENT ON TABLE nd_experiment_analysis IS 'An analysis that is used in an exper
 -- Name: nd_experiment_analysis_nd_experiment_analysis_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE nd_experiment_analysis_nd_experiment_analysis_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS nd_experiment_analysis_nd_experiment_analysis_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: nd_experiment_analysis_nd_experiment_analysis_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: chado
@@ -4774,12 +4774,12 @@ the default 0 value should be used';
 -- Name: organism_cvterm_organism_cvterm_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE organism_cvterm_organism_cvterm_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS organism_cvterm_organism_cvterm_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: organism_cvterm_organism_cvterm_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: chado
@@ -4843,12 +4843,12 @@ the default 0 value should be used';
 -- Name: organism_cvtermprop_organism_cvtermprop_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE organism_cvtermprop_organism_cvtermprop_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS organism_cvtermprop_organism_cvtermprop_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: organism_cvtermprop_organism_cvtermprop_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: chado
@@ -4893,12 +4893,12 @@ COMMENT ON TABLE organism_pub IS 'Attribution for organism.';
 -- Name: organism_pub_organism_pub_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE organism_pub_organism_pub_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS organism_pub_organism_pub_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: organism_pub_organism_pub_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: chado
@@ -4933,12 +4933,12 @@ relatinoships should be housed in the phylogeny tables.';
 -- Name: organism_relationship_organism_relationship_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE organism_relationship_organism_relationship_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS organism_relationship_organism_relationship_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: organism_relationship_organism_relationship_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: chado
@@ -4978,12 +4978,12 @@ COMMENT ON TABLE organismprop_pub IS 'Attribution for organismprop.';
 -- Name: organismprop_pub_organismprop_pub_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE organismprop_pub_organismprop_pub_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS organismprop_pub_organismprop_pub_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: organismprop_pub_organismprop_pub_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: chado
@@ -5077,12 +5077,12 @@ COMMENT ON TABLE phenotypeprop IS 'A phenotype can have any number of slot-value
 -- Name: phenotypeprop_phenotypeprop_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE phenotypeprop_phenotypeprop_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS phenotypeprop_phenotypeprop_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: phenotypeprop_phenotypeprop_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: chado
@@ -5233,12 +5233,12 @@ default 0 value should be used';
 -- Name: phylotreeprop_phylotreeprop_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE phylotreeprop_phylotreeprop_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS phylotreeprop_phylotreeprop_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 
 --
@@ -5287,12 +5287,12 @@ The rank column can be used to specify a simple ordering in which analyses were
 -- Name: project_analysis_project_analysis_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE project_analysis_project_analysis_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS project_analysis_project_analysis_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 
 --
@@ -5347,12 +5347,12 @@ COMMENT ON COLUMN project_dbxref.is_current IS 'The is_current boolean indicates
 -- Name: project_dbxref_project_dbxref_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE project_dbxref_project_dbxref_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS project_dbxref_project_dbxref_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: project_dbxref_project_dbxref_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: chado
@@ -5383,12 +5383,12 @@ COMMENT ON TABLE project_feature IS 'This table is intended associate records in
 -- Name: project_feature_project_feature_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE project_feature_project_feature_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS project_feature_project_feature_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: project_feature_project_feature_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: chado
@@ -5453,12 +5453,12 @@ COMMENT ON TABLE project_stock IS 'This table is intended associate records in t
 -- Name: project_stock_project_stock_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE project_stock_project_stock_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS project_stock_project_stock_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 --
 -- Name: projectprop; Type: TABLE; Schema: public; Owner: chado; Tablespace: 
 --
@@ -5537,12 +5537,12 @@ COMMENT ON TABLE pubauthor_contact IS 'An author on a publication may have a cor
 -- Name: pubauthor_contact_pubauthor_contact_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE pubauthor_contact_pubauthor_contact_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS pubauthor_contact_pubauthor_contact_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: pubauthor_contact_pubauthor_contact_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: chado
@@ -5660,12 +5660,12 @@ COMMENT ON TABLE stock_feature IS 'Links a stock to a feature.';
 -- Name: stock_feature_stock_feature_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE stock_feature_stock_feature_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS stock_feature_stock_feature_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: stock_feature_stock_feature_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: chado
@@ -5697,12 +5697,12 @@ COMMENT ON TABLE stock_featuremap IS 'Links a featuremap to a stock.';
 -- Name: stock_featuremap_stock_featuremap_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE stock_featuremap_stock_featuremap_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS stock_featuremap_stock_featuremap_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: stock_genotype; Type: TABLE; Schema: public; Owner: chado; Tablespace: 
@@ -5735,12 +5735,12 @@ COMMENT ON TABLE stock_library IS 'Links a stock with a library.';
 -- Name: stock_library_stock_library_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE stock_library_stock_library_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS stock_library_stock_library_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: stock_pub; Type: TABLE; Schema: public; Owner: chado; Tablespace: 
@@ -5815,12 +5815,12 @@ db_id record';
 -- Name: stockcollection_db_stockcollection_db_id_seq; Type: SEQUENCE; Schema: public; Owner: chado
 --
 
----CREATE SEQUENCE stockcollection_db_stockcollection_db_id_seq
----    START WITH 1
----    INCREMENT BY 1
----    NO MINVALUE
----    NO MAXVALUE
----    CACHE 1;
+CREATE SEQUENCE IF NOT EXISTS stockcollection_db_stockcollection_db_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
 
 --
 -- Name: stockcollection_stock; Type: TABLE; Schema: public; Owner: chado; Tablespace: 

+ 4 - 4
tripal_chado/includes/TripalFields/ChadoField.inc

@@ -2,7 +2,7 @@
 
 class ChadoField extends TripalField {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Chado Field';
 
   // The default description for this field.
@@ -17,15 +17,15 @@ class ChadoField extends TripalField {
     'storage' => 'field_chado_storage',
   ];
 
-  // Provide a list of instance specific settings. These can be access within
+  // Provide a list of instance specific settings. These can be accessed within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
-  // then Drupal with automatically change these settings for the instnace.
+  // then Drupal will automatically change these settings for the instance.
   // It is recommended to put settings at the instance level whenever possible.
   // If you override this variable in a child class be sure to replicate the
   // term_name, term_vocab, term_accession and term_fixed keys as these are
   // required for all TripalFields.
   public static $default_instance_settings = [
-    // The short name for the vocabulary (e.g. shcema, SO, GO, PATO, etc.).
+    // The short name for the vocabulary (e.g. schema, SO, GO, PATO, etc.).
     'term_vocabulary' => 'schema',
     // The name of the term.
     'term_name' => 'Thing',

+ 4 - 4
tripal_chado/includes/TripalFields/chado_linker__contact/chado_linker__contact.inc

@@ -11,22 +11,22 @@ class chado_linker__contact extends ChadoField {
   // the field and it's default widget and formatter.
   // --------------------------------------------------------------------------
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Contacts';
 
   // The default description for this field.
   public static $description = 'Associates an indviddual or organization with
           this record';
 
-  // Provide a list of instance specific settings. These can be access within
+  // Provide a list of instance specific settings. These can be accessed within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
-  // then Drupal with automatically change these settings for the instnace.
+  // then Drupal will automatically change these settings for the instance.
   // It is recommended to put settings at the instance level whenever possible.
   // If you override this variable in a child class be sure to replicate the
   // term_name, term_vocab, term_accession and term_fixed keys as these are
   // required for all TripalFields.
   public static $default_instance_settings = [
-    // The short name for the vocabulary (e.g. shcema, SO, GO, PATO, etc.).
+    // The short name for the vocabulary (e.g. schema, SO, GO, PATO, etc.).
     'term_vocabulary' => 'local',
     // The name of the term.
     'term_name' => 'contact',

+ 1 - 1
tripal_chado/includes/TripalFields/chado_linker__contact/chado_linker__contact_formatter.inc

@@ -2,7 +2,7 @@
 
 class chado_linker__contact_formatter extends ChadoFieldFormatter {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Contacts';
 
   // The list of field types for which this formatter is appropriate.

+ 1 - 1
tripal_chado/includes/TripalFields/chado_linker__contact/chado_linker__contact_widget.inc

@@ -2,7 +2,7 @@
 
 class chado_linker__contact_widget extends ChadoFieldWidget {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Contacts';
 
   // The list of field types for which this formatter is appropriate.

+ 4 - 4
tripal_chado/includes/TripalFields/chado_linker__prop/chado_linker__prop.inc

@@ -11,21 +11,21 @@ class chado_linker__prop extends ChadoField {
   // the field and it's default widget and formatter.
   // --------------------------------------------------------------------------
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Chado Property';
 
   // The default description for this field.
   public static $description = 'Add details about this property.';
 
-  // Provide a list of instance specific settings. These can be access within
+  // Provide a list of instance specific settings. These can be accessed within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
-  // then Drupal with automatically change these settings for the instnace.
+  // then Drupal will automatically change these settings for the instance.
   // It is recommended to put settings at the instance level whenever possible.
   // If you override this variable in a child class be sure to replicate the
   // term_name, term_vocab, term_accession and term_fixed keys as these are
   // required for all TripalFields.
   public static $default_instance_settings = [
-    // The short name for the vocabulary (e.g. shcema, SO, GO, PATO, etc.).
+    // The short name for the vocabulary (e.g. schema, SO, GO, PATO, etc.).
     'term_vocabulary' => 'local',
     // The name of the term.
     'term_name' => 'property',

+ 1 - 1
tripal_chado/includes/TripalFields/chado_linker__prop/chado_linker__prop_formatter.inc

@@ -2,7 +2,7 @@
 
 class chado_linker__prop_formatter extends ChadoFieldFormatter {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Chado Property';
 
   // The list of field types for which this formatter is appropriate.

+ 1 - 1
tripal_chado/includes/TripalFields/chado_linker__prop/chado_linker__prop_widget.inc

@@ -2,7 +2,7 @@
 
 class chado_linker__prop_widget extends ChadoFieldWidget {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Chado Property';
 
   // The list of field types for which this formatter is appropriate.

+ 4 - 4
tripal_chado/includes/TripalFields/data__accession/data__accession.inc

@@ -11,21 +11,21 @@ class data__accession extends ChadoField {
   // the field and it's default widget and formatter.
   // --------------------------------------------------------------------------
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Site Accession';
 
   // The default description for this field.
   public static $description = 'The unique stable accession (ID) for this record on this site.';
 
-  // Provide a list of instance specific settings. These can be access within
+  // Provide a list of instance specific settings. These can be accessed within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
-  // then Drupal with automatically change these settings for the instnace.
+  // then Drupal will automatically change these settings for the instance.
   // It is recommended to put settings at the instance level whenever possible.
   // If you override this variable in a child class be sure to replicate the
   // term_name, term_vocab, term_accession and term_fixed keys as these are
   // required for all TripalFields.
   public static $default_instance_settings = [
-    // The short name for the vocabulary (e.g. shcema, SO, GO, PATO, etc.).
+    // The short name for the vocabulary (e.g. schema, SO, GO, PATO, etc.).
     'term_vocabulary' => 'data',
     // The name of the term.
     'term_name' => 'accession',

+ 1 - 1
tripal_chado/includes/TripalFields/data__accession/data__accession_formatter.inc

@@ -2,7 +2,7 @@
 
 class data__accession_formatter extends ChadoFieldFormatter {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Site Accession';
 
   // The list of field types for which this formatter is appropriate.

+ 1 - 1
tripal_chado/includes/TripalFields/data__accession/data__accession_widget.inc

@@ -2,7 +2,7 @@
 
 class data__accession_widget extends ChadoFieldWidget {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Site Accession';
 
   // The list of field types for which this formatter is appropriate.

+ 6 - 6
tripal_chado/includes/TripalFields/data__protein_sequence/data__protein_sequence.inc

@@ -11,21 +11,21 @@ class data__protein_sequence extends ChadoField {
   // the field and it's default widget and formatter.
   // --------------------------------------------------------------------------
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Protein Sequence';
 
   // The default description for this field.
   public static $description = 'polypeptide sequences.';
 
-  // Provide a list of instance specific settings. These can be access within
+  // Provide a list of instance specific settings. These can be accessed within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
-  // then Drupal with automatically change these settings for the instnace.
+  // then Drupal will automatically change these settings for the instance.
   // It is recommended to put settings at the instance level whenever possible.
   // If you override this variable in a child class be sure to replicate the
   // term_name, term_vocab, term_accession and term_fixed keys as these are
   // required for all TripalFields.
   public static $default_instance_settings = [
-    // The short name for the vocabulary (e.g. shcema, SO, GO, PATO, etc.).
+    // The short name for the vocabulary (e.g. schema, SO, GO, PATO, etc.).
     'term_vocabulary' => 'data',
     // The name of the term.
     'term_name' => 'protein_sequence',
@@ -93,7 +93,7 @@ class data__protein_sequence extends ChadoField {
       WHERE
         FR.object_id = :feature_id and
         CVT.name = 'polypeptide' and
-        RCVT.name = 'derives_from'
+        RCVT.name  IN ('derives_from', 'part_of')
       ORDER BY FR.rank ASC
     ";
     $proteins = chado_query($sql, [':feature_id' => $feature->feature_id]);
@@ -108,4 +108,4 @@ class data__protein_sequence extends ChadoField {
       $num_seqs++;
     }
   }
-}
+}

+ 1 - 1
tripal_chado/includes/TripalFields/data__protein_sequence/data__protein_sequence_formatter.inc

@@ -2,7 +2,7 @@
 
 class data__protein_sequence_formatter extends ChadoFieldFormatter {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Protein Sequence';
 
   // The list of field types for which this formatter is appropriate.

+ 1 - 1
tripal_chado/includes/TripalFields/data__protein_sequence/data__protein_sequence_widget.inc

@@ -2,7 +2,7 @@
 
 class data__protein_sequence_widget extends ChadoFieldWidget {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Protein Sequence';
 
   // The list of field types for which this formatter is appropriate.

+ 4 - 4
tripal_chado/includes/TripalFields/data__sequence/data__sequence.inc

@@ -11,21 +11,21 @@ class data__sequence extends ChadoField {
   // the field and it's default widget and formatter.
   // --------------------------------------------------------------------------
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Sequence';
 
   // The default description for this field.
   public static $description = 'A field for managing nucleotide and protein residues.';
 
-  // Provide a list of instance specific settings. These can be access within
+  // Provide a list of instance specific settings. These can be accessed within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
-  // then Drupal with automatically change these settings for the instnace.
+  // then Drupal will automatically change these settings for the instance.
   // It is recommended to put settings at the instance level whenever possible.
   // If you override this variable in a child class be sure to replicate the
   // term_name, term_vocab, term_accession and term_fixed keys as these are
   // required for all TripalFields.
   public static $default_instance_settings = [
-    // The short name for the vocabulary (e.g. shcema, SO, GO, PATO, etc.).
+    // The short name for the vocabulary (e.g. schema, SO, GO, PATO, etc.).
     'term_vocabulary' => 'data',
     // The name of the term.
     'term_name' => 'sequence',

+ 1 - 1
tripal_chado/includes/TripalFields/data__sequence/data__sequence_formatter.inc

@@ -2,7 +2,7 @@
 
 class data__sequence_formatter extends ChadoFieldFormatter {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Sequence';
 
   // The list of field types for which this formatter is appropriate.

+ 1 - 1
tripal_chado/includes/TripalFields/data__sequence/data__sequence_widget.inc

@@ -2,7 +2,7 @@
 
 class data__sequence_widget extends ChadoFieldWidget {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Sequence';
 
   // The list of field types for which this formatter is appropriate.

+ 4 - 4
tripal_chado/includes/TripalFields/data__sequence_checksum/data__sequence_checksum.inc

@@ -11,21 +11,21 @@ class data__sequence_checksum extends ChadoField {
   // the field and it's default widget and formatter.
   // --------------------------------------------------------------------------
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Sequence checksum';
 
   // The default description for this field.
   public static $description = 'A field for generating MD5 checksum for a sequence.';
 
-  // Provide a list of instance specific settings. These can be access within
+  // Provide a list of instance specific settings. These can be accessed within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
-  // then Drupal with automatically change these settings for the instnace.
+  // then Drupal will automatically change these settings for the instance.
   // It is recommended to put settings at the instance level whenever possible.
   // If you override this variable in a child class be sure to replicate the
   // term_name, term_vocab, term_accession and term_fixed keys as these are
   // required for all TripalFields.
   public static $default_instance_settings = [
-    // The short name for the vocabulary (e.g. shcema, SO, GO, PATO, etc.).
+    // The short name for the vocabulary (e.g. schema, SO, GO, PATO, etc.).
     'term_vocabulary' => 'data',
     // The name of the term.
     'term_name' => 'sequence_checksum',

+ 1 - 1
tripal_chado/includes/TripalFields/data__sequence_checksum/data__sequence_checksum_formatter.inc

@@ -2,7 +2,7 @@
 
 class data__sequence_checksum_formatter extends ChadoFieldFormatter {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Sequence checksum';
 
   // The list of field types for which this formatter is appropriate.

+ 1 - 1
tripal_chado/includes/TripalFields/data__sequence_checksum/data__sequence_checksum_widget.inc

@@ -2,7 +2,7 @@
 
 class data__sequence_checksum_widget extends ChadoFieldWidget {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Sequence checksum';
 
   // The list of field types for which this formatter is appropriate.

+ 4 - 4
tripal_chado/includes/TripalFields/data__sequence_coordinates/data__sequence_coordinates.inc

@@ -11,21 +11,21 @@ class data__sequence_coordinates extends ChadoField {
   // the field and it's default widget and formatter.
   // --------------------------------------------------------------------------
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Sequence Coordinates';
 
   // The default description for this field.
   public static $description = 'Locations on reference sequences where the feature is located.';
 
-  // Provide a list of instance specific settings. These can be access within
+  // Provide a list of instance specific settings. These can be accessed within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
-  // then Drupal with automatically change these settings for the instnace.
+  // then Drupal will automatically change these settings for the instance.
   // It is recommended to put settings at the instance level whenever possible.
   // If you override this variable in a child class be sure to replicate the
   // term_name, term_vocab, term_accession and term_fixed keys as these are
   // required for all TripalFields.
   public static $default_instance_settings = [
-    // The short name for the vocabulary (e.g. shcema, SO, GO, PATO, etc.).
+    // The short name for the vocabulary (e.g. schema, SO, GO, PATO, etc.).
     'term_vocabulary' => 'data',
     // The name of the term.
     'term_name' => 'sequence_coordinates',

+ 1 - 1
tripal_chado/includes/TripalFields/data__sequence_coordinates/data__sequence_coordinates_formatter.inc

@@ -2,7 +2,7 @@
 
 class data__sequence_coordinates_formatter extends ChadoFieldFormatter {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Sequence Coordinate List';
 
   // The list of field types for which this formatter is appropriate.

+ 1 - 1
tripal_chado/includes/TripalFields/data__sequence_coordinates/data__sequence_coordinates_widget.inc

@@ -2,7 +2,7 @@
 
 class data__sequence_coordinates_widget extends ChadoFieldWidget {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Sequence Coordinates';
 
   // The list of field types for which this formatter is appropriate.

+ 1 - 1
tripal_chado/includes/TripalFields/data__sequence_coordinates_table/data__sequence_coordinates_table_formatter.inc

@@ -2,7 +2,7 @@
 
 class data__sequence_coordinates_table_formatter extends ChadoFieldFormatter {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Sequence Coordinate Table';
 
   // The list of field types for which this formatter is appropriate.

+ 4 - 4
tripal_chado/includes/TripalFields/data__sequence_length/data__sequence_length.inc

@@ -12,21 +12,21 @@ class data__sequence_length extends ChadoField {
   // --------------------------------------------------------------------------
 
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Sequence length';
 
   // The default description for this field.
   public static $description = 'A field for calculating the length of a sequence.';
 
-  // Provide a list of instance specific settings. These can be access within
+  // Provide a list of instance specific settings. These can be accessed within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
-  // then Drupal with automatically change these settings for the instnace.
+  // then Drupal will automatically change these settings for the instance.
   // It is recommended to put settings at the instance level whenever possible.
   // If you override this variable in a child class be sure to replicate the
   // term_name, term_vocab, term_accession and term_fixed keys as these are
   // required for all TripalFields.
   public static $default_instance_settings = [
-    // The short name for the vocabulary (e.g. shcema, SO, GO, PATO, etc.).
+    // The short name for the vocabulary (e.g. schema, SO, GO, PATO, etc.).
     'term_vocabulary' => 'data',
     // The name of the term.
     'term_name' => 'sequence_length',

+ 1 - 1
tripal_chado/includes/TripalFields/data__sequence_length/data__sequence_length_formatter.inc

@@ -2,7 +2,7 @@
 
 class data__sequence_length_formatter extends ChadoFieldFormatter {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Sequence length';
 
   // The list of field types for which this formatter is appropriate.

+ 1 - 1
tripal_chado/includes/TripalFields/data__sequence_length/data__sequence_length_widget.inc

@@ -2,7 +2,7 @@
 
 class data__sequence_length_widget extends ChadoFieldWidget {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Sequence length';
 
   // The list of field types for which this formatter is appropriate.

+ 4 - 4
tripal_chado/includes/TripalFields/efo__array_design/efo__array_design.inc

@@ -2,21 +2,21 @@
 
 class efo__array_design extends ChadoField {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Array Design';
 
   // The default description for this field.
   public static $description = 'An instrument design which describes the design of the array.';
 
-  // Provide a list of instance specific settings. These can be access within
+  // Provide a list of instance specific settings. These can be accessed within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
-  // then Drupal with automatically change these settings for the instnace.
+  // then Drupal will automatically change these settings for the instance.
   // It is recommended to put settings at the instance level whenever possible.
   // If you override this variable in a child class be sure to replicate the
   // term_name, term_vocab, term_accession and term_fixed keys as these are
   // required for all TripalFields.
   public static $default_instance_settings = [
-    // The short name for the vocabulary (e.g. shcema, SO, GO, PATO, etc.).
+    // The short name for the vocabulary (e.g. schema, SO, GO, PATO, etc.).
     'term_vocabulary' => 'EFO',
     // The name of the term.
     'term_name' => 'array design',

+ 1 - 1
tripal_chado/includes/TripalFields/efo__array_design/efo__array_design_formatter.inc

@@ -2,7 +2,7 @@
 
 class efo__array_design_formatter extends ChadoFieldFormatter {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Array Design';
 
   // The list of field types for which this formatter is appropriate.

+ 1 - 1
tripal_chado/includes/TripalFields/efo__array_design/efo__array_design_widget.inc

@@ -2,7 +2,7 @@
 
 class efo__array_design_widget extends ChadoFieldWidget {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Array Design';
 
   // The list of field types for which this formatter is appropriate.

+ 4 - 4
tripal_chado/includes/TripalFields/go__gene_expression/go__gene_expression.inc

@@ -11,7 +11,7 @@ class go__gene_expression extends ChadoField {
   // the field and it's default widget and formatter.
   // --------------------------------------------------------------------------
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Gene expression';
 
   // The default description for this field.
@@ -22,15 +22,15 @@ class go__gene_expression extends ChadoField {
       Protein maturation is included when required to form an active form of a product from
       an inactive precursor form.';
 
-  // Provide a list of instance specific settings. These can be access within
+  // Provide a list of instance specific settings. These can be accessed within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
-  // then Drupal with automatically change these settings for the instnace.
+  // then Drupal will automatically change these settings for the instance.
   // It is recommended to put settings at the instance level whenever possible.
   // If you override this variable in a child class be sure to replicate the
   // term_name, term_vocab, term_accession and term_fixed keys as these are
   // required for all TripalFields.
   public static $default_instance_settings = [
-    // The short name for the vocabulary (e.g. shcema, SO, GO, PATO, etc.).
+    // The short name for the vocabulary (e.g. schema, SO, GO, PATO, etc.).
     'term_vocabulary' => 'GO',
     // The name of the term.
     'term_name' => 'gene expression',

+ 1 - 1
tripal_chado/includes/TripalFields/go__gene_expression/go__gene_expression_formatter.inc

@@ -2,7 +2,7 @@
 
 class go__gene_expression_formatter extends ChadoFieldFormatter {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Gene expression';
 
   // The list of field types for which this formatter is appropriate.

+ 1 - 1
tripal_chado/includes/TripalFields/go__gene_expression/go__gene_expression_widget.inc

@@ -2,7 +2,7 @@
 
 class go__gene_expression_widget extends ChadoFieldWidget {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Gene expression';
 
   // The list of field types for which this formatter is appropriate.

+ 4 - 4
tripal_chado/includes/TripalFields/local__contact/local__contact.inc

@@ -11,21 +11,21 @@ class local__contact extends ChadoField {
   // the field and it's default widget and formatter.
   // --------------------------------------------------------------------------
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Contact';
 
   // The default description for this field.
   public static $description = 'An indviddual or organization that serves as a contact for this record.';
 
-  // Provide a list of instance specific settings. These can be access within
+  // Provide a list of instance specific settings. These can be accessed within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
-  // then Drupal with automatically change these settings for the instnace.
+  // then Drupal will automatically change these settings for the instance.
   // It is recommended to put settings at the instance level whenever possible.
   // If you override this variable in a child class be sure to replicate the
   // term_name, term_vocab, term_accession and term_fixed keys as these are
   // required for all TripalFields.
   public static $default_instance_settings = [
-    // The short name for the vocabulary (e.g. shcema, SO, GO, PATO, etc.).
+    // The short name for the vocabulary (e.g. schema, SO, GO, PATO, etc.).
     'term_vocabulary' => 'local',
     // The name of the term.
     'term_name' => 'contact',

+ 1 - 1
tripal_chado/includes/TripalFields/local__contact/local__contact_formatter.inc

@@ -2,7 +2,7 @@
 
 class local__contact_formatter extends ChadoFieldFormatter {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Contact';
 
   // The list of field types for which this formatter is appropriate.

+ 1 - 1
tripal_chado/includes/TripalFields/local__contact/local__contact_widget.inc

@@ -2,7 +2,7 @@
 
 class local__contact_widget extends ChadoFieldWidget {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Contact';
 
   // The list of field types for which this formatter is appropriate.

+ 4 - 4
tripal_chado/includes/TripalFields/local__source_data/local__source_data.inc

@@ -11,21 +11,21 @@ class local__source_data extends ChadoField {
   // the field and it's default widget and formatter.
   // --------------------------------------------------------------------------
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Source of Data';
 
   // The default description for this field.
   public static $description = 'The source data used for this analysis.';
 
-  // Provide a list of instance specific settings. These can be access within
+  // Provide a list of instance specific settings. These can be accessed within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
-  // then Drupal with automatically change these settings for the instnace.
+  // then Drupal will automatically change these settings for the instance.
   // It is recommended to put settings at the instance level whenever possible.
   // If you override this variable in a child class be sure to replicate the
   // term_name, term_vocab, term_accession and term_fixed keys as these are
   // required for all TripalFields.
   public static $default_instance_settings = [
-    // The short name for the vocabulary (e.g. shcema, SO, GO, PATO, etc.).
+    // The short name for the vocabulary (e.g. schema, SO, GO, PATO, etc.).
     'term_vocabulary' => 'local',
     // The name of the term.
     'term_name' => 'source_data',

+ 1 - 1
tripal_chado/includes/TripalFields/local__source_data/local__source_data_formatter.inc

@@ -2,7 +2,7 @@
 
 class local__source_data_formatter extends ChadoFieldFormatter {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Data Source';
 
   // The list of field types for which this formatter is appropriate.

+ 1 - 1
tripal_chado/includes/TripalFields/local__source_data/local__source_data_widget.inc

@@ -2,7 +2,7 @@
 
 class local__source_data_widget extends ChadoFieldWidget {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Data Source';
 
   // The list of field types for which this formatter is appropriate.

+ 4 - 4
tripal_chado/includes/TripalFields/obi__organism/obi__organism.inc

@@ -2,21 +2,21 @@
 
 class obi__organism extends ChadoField {
 
-  // The default lable for this field.
+  // The default label for this field.
   public static $default_label = 'Organism';
 
   // The default description for this field.
   public static $description = 'The organism to which this resource is associated.';
 
-  // Provide a list of instance specific settings. These can be access within
+  // Provide a list of instance specific settings. These can be accessed within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
-  // then Drupal with automatically change these settings for the instnace.
+  // then Drupal will automatically change these settings for the instance.
   // It is recommended to put settings at the instance level whenever possible.
   // If you override this variable in a child class be sure to replicate the
   // term_name, term_vocab, term_accession and term_fixed keys as these are
   // required for all TripalFields.
   public static $default_instance_settings = [
-    // The short name for the vocabulary (e.g. shcema, SO, GO, PATO, etc.).
+    // The short name for the vocabulary (e.g. schema, SO, GO, PATO, etc.).
     'term_vocabulary' => 'OBI',
     // The name of the term.
     'term_name' => 'organism',

Some files were not shown because too many files changed in this diff