31
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-05-31 21:00:47 +00:00

Truncate the item descriptions when inserting pull data into the database

This commit is contained in:
Michael Babker 2015-05-09 13:13:31 -04:00
parent a64e0b57df
commit dce7a865e9
6 changed files with 6 additions and 6 deletions

View File

@ -343,7 +343,7 @@ class PullsModel extends \JModelDatabase
foreach ($pulls as $pull)
{
// Build the data object to store in the database
$pullData = array($pull->number, $pull->title, $pull->body, $pull->html_url);
$pullData = array($pull->number, $pull->title, \JHtml::_('string.truncateComplex', $pull->body, 100), $pull->html_url);
$data[] = implode($this->getDb()->quote($pullData), ',');
}

View File

@ -20,7 +20,7 @@ foreach ($this->items as $i => $item) :
<?php echo $item->pull_id; ?>
</td>
<td>
<span class="hasTooltip" title="<strong>Info</strong><br/><?php echo $this->escape(\JHtml::_('string.truncateComplex', $item->description, 50)); ?>"><?php echo $this->escape($item->title); ?></span>
<span class="hasTooltip" title="<strong>Info</strong><br/><?php echo $this->escape($item->description); ?>"><?php echo $this->escape($item->title); ?></span>
</td>
<td class="center">
<a class="btn btn-small btn-info" href="<?php echo $item->pull_url; ?>" target="_blank">

View File

@ -2,7 +2,7 @@ CREATE TABLE IF NOT EXISTS `#__patchtester_pulls` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`pull_id` int(11) NOT NULL,
`title` varchar(200) NOT NULL,
`description` varchar(5000) NOT NULL DEFAULT '',
`description` varchar(150) NOT NULL DEFAULT '',
`pull_url` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;

View File

@ -2,7 +2,7 @@ CREATE TABLE IF NOT EXISTS "#__patchtester_pulls" (
"id" serial NOT NULL,
"pull_id" bigint NOT NULL,
"title" character varying(200) NOT NULL,
"description" character varying(5000) DEFAULT '' NOT NULL,
"description" character varying(150) DEFAULT '' NOT NULL,
"pull_url" character varying(255) NOT NULL,
PRIMARY KEY ("id")
);

View File

@ -2,7 +2,7 @@ CREATE TABLE [#__patchtester_pulls] (
[id] [bigint] IDENTITY(1,1) NOT NULL,
[pull_id] [bigint] NOT NULL,
[title] [nvarchar](200) NOT NULL,
[description] [nvarchar](4000) NOT NULL DEFAULT '',
[description] [nvarchar](150) NOT NULL DEFAULT '',
[pull_url] [nvarchar](255) NOT NULL,
CONSTRAINT [PK_#__patchtester_pulls] PRIMARY KEY CLUSTERED
(

View File

@ -21,7 +21,7 @@ foreach ($this->items as $i => $item) :
<?php echo $item->pull_id; ?>
</td>
<td>
<p class="hasTooltip" title="<?php echo $this->escape(\JHtml::_('string.truncateComplex', $item->description, 100)); ?>">
<p class="hasTooltip" title="<?php echo $this->escape($item->description); ?>">
<?php echo $this->escape($item->title); ?>
</p>
</td>