In the function "nodeownership_claim_form" (found in file nodeownership.pages.inc) the following existing line retrieves node titlefrom the database, but then nothing is done with it:

$node_title = db_query("SELECT title FROM {node} WHERE nid = :nid", array(':nid' => $nid))->fetchField();

It would be useful to:
1. Retrieve the title in a way that takes possible translations and the current language into account.
2. Include the node title within the page title, thus giving additional context to the user.

The following workaround is a replacement for the above line of code:

  $claimed_node = node_load($nid);
  $page_title = t('Claim control of:').' '.$claimed_node->title;
  drupal_set_title($page_title);

Slightly more complex, but more useful, would be for the claim page's title to be configurable on the module's admin page, with a token avaialable for %node_title. The current fixed title "Claim node" is unlikely to be a desirable title in most cases, as users generally have no idea what a "node" is.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sja1’s picture

Status: Active » Needs review
FileSize
673 bytes

Attaching patch.

sja1’s picture

Fixing malformed patch.

rajeshwari10’s picture

Status: Needs review » Reviewed & tested by the community

Hi All,

I have reviewed the latest patch and its working as per required.

Thanks!

ashishdalvi’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/includes/nodeownership.pages.inc
@@ -45,7 +45,9 @@ function nodeownership_get_claim($node)
+  $page_title = t('Claim control of:').' '.$claimed_node->title;

Drupal Coding standard suggestion.

1. Always use a space between the dot and the concatenated parts to improve readability.

https://www.drupal.org/coding-standards#concat

Sonal.Sangale’s picture

Assigned: Unassigned » Sonal.Sangale
Status: Needs work » Needs review
FileSize
691 bytes

Added space in string and concatenation operator.

swarad07’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

ashishdalvi’s picture

Status: Reviewed & tested by the community » Fixed

Thank for patch and Review.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.