There are occasions when it's useful to display the plural form of relationship type names. Depending on the type name, simply adding an 's' may not work (e.g. 'buddys' is not the plural of 'buddy'). The attached patch:
+ modifies the schema to add a 'plural_name' column to the user_relationship_types table;
+ modifies the rel type add/edit form to allows specifying a plural form (defaults to adding an 's' if left blank);
+ modifies the relationship type list page to display the plural form of the name (and the expiration value - see below); and
+ modifies relevant theme functions and page titles to use the plural form of the name.

While I was in the code, I also made the following changes, unrelated to pluralizing the type name:
+ modified the relationship type list page to display the expiration value;
+ tightened up validation of relationship type name (don't allow editing an existing type name to match a different existing type);
+ fixed the page title of the user_relationships_page to reflect the user actually being viewed.
Sorry for cluttering up the patch with unrelated code. Hope the code's useful enough to keep anyway.

CommentFileSizeAuthor
urplural.patch11.64 KBprfctns6@gmail.com
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sprsquish’s picture

Status: Needs review » Closed (fixed)

Patched in pluralization with a few mods.

I don't want to force a pluralization on people. If they don't want to set it, we wont use it. Simplified things on our end and leaves responsibility with the admin.

I also refactored the installation script. There was was way too much duplication going on. No need for that kind of nonsense.