[invalid] description tag gives empty value

Post Reply
deactivated010521

[invalid] description tag gives empty value

Post by deactivated010521 »

Rev: 8101

The {description} tag gives back an empty value.

/plugins/function.description.php

Code: Select all

$result = $content_obj->TitleAttribute();

  public function TitleAttribute()
  {
    return $this->mTitleAttribute;
  }


To fix:


--- lib/classes/class.ContentBase.php (revision 8101)
+++ lib/classes/class.ContentBase.php (working copy)
@@ -1305,7 +1305,7 @@
$this->mHierarchyPath = $row->fields["hierarchy_path"];
$this->mMenuText = $row->fields['menu_text'];
$this->mMarkup = $row->fields['markup'];
- $this->mTitleAttribute = $row->fields['titleattribute'];
+ $this->mTitleAttribute = $row->fields['content_name'];


See database fieldnames:

Code: Select all

mysql> desc cms_content;
+------------------+--------------+------+-----+---------+-------+
| Field            | Type         | Null | Key | Default | Extra |
+------------------+--------------+------+-----+---------+-------+
| content_id       | int(11)      | NO   | PRI | NULL    |       |
| content_name     | varchar(255) | YES  |     | NULL    |       | <--------
| type             | varchar(25)  | YES  |     | NULL    |       |
| owner_id         | int(11)      | YES  |     | NULL    |       |
| parent_id        | int(11)      | YES  | MUL | NULL    |       |
| template_id      | int(11)      | YES  |     | NULL    |       |
| item_order       | int(11)      | YES  |     | NULL    |       |
| hierarchy        | varchar(255) | YES  | MUL | NULL    |       |
| default_content  | tinyint(4)   | YES  | MUL | NULL    |       |
| menu_text        | varchar(255) | YES  |     | NULL    |       |
| content_alias    | varchar(255) | YES  | MUL | NULL    |       |
| show_in_menu     | tinyint(4)   | YES  |     | NULL    |       |
| collapsed        | tinyint(4)   | YES  |     | NULL    |       |
| markup           | varchar(25)  | YES  |     | NULL    |       |
| active           | tinyint(4)   | YES  |     | NULL    |       |
| cachable         | tinyint(4)   | YES  |     | NULL    |       |
| id_hierarchy     | varchar(255) | YES  |     | NULL    |       |
| hierarchy_path   | text         | YES  |     | NULL    |       |
| prop_names       | text         | YES  |     | NULL    |       |
| metadata         | text         | YES  |     | NULL    |       |
| titleattribute   | varchar(255) | YES  |     | NULL    |       |
| tabindex         | varchar(10)  | YES  |     | NULL    |       |
| accesskey        | varchar(5)   | YES  |     | NULL    |       |
| last_modified_by | int(11)      | YES  |     | NULL    |       |
| create_date      | datetime     | YES  |     | NULL    |       |
| modified_date    | datetime     | YES  |     | NULL    |       |
| secure           | tinyint(4)   | YES  |     | NULL    |       |
| page_url         | varchar(255) | YES  |     | NULL    |       |
+------------------+--------------+------+-----+---------+-------+
BTW by looking into: plugins/function.title.php I saw the result is filtered by cms_htmlentities

Code: Select all

$result = cms_htmlentities($contentobj->Name());
The result of function.description.php is not filtered.

Code: Select all

$result = $content_obj->TitleAttribute();
Last edited by deactivated010521 on Sun Jun 24, 2012 4:06 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: description tag gives empty value

Post by calguy1000 »

a: your code is incorrect.
b: just tested the {description} tag, works fine for me.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
deactivated010521

Re: [invalid] description tag gives empty value

Post by deactivated010521 »

oeps your are right, topic marked as [invalid]
Post Reply

Return to “Closed Issues”