Skip to content

Commit dce7a86

Browse files
author
Michael Babker
committed
Truncate the item descriptions when inserting pull data into the database
1 parent a64e0b5 commit dce7a86

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

administrator/components/com_patchtester/PatchTester/Model/PullsModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ public function requestFromGithub($page)
343343
foreach ($pulls as $pull)
344344
{
345345
// Build the data object to store in the database
346-
$pullData = array($pull->number, $pull->title, $pull->body, $pull->html_url);
346+
$pullData = array($pull->number, $pull->title, \JHtml::_('string.truncateComplex', $pull->body, 100), $pull->html_url);
347347
$data[] = implode($this->getDb()->quote($pullData), ',');
348348
}
349349

administrator/components/com_patchtester/PatchTester/View/Pulls/tmpl/default_items.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<?php echo $item->pull_id; ?>
2121
</td>
2222
<td>
23-
<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>
23+
<span class="hasTooltip" title="<strong>Info</strong><br/><?php echo $this->escape($item->description); ?>"><?php echo $this->escape($item->title); ?></span>
2424
</td>
2525
<td class="center">
2626
<a class="btn btn-small btn-info" href="<?php echo $item->pull_url; ?>" target="_blank">

administrator/components/com_patchtester/install/sql/mysql/install.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CREATE TABLE IF NOT EXISTS `#__patchtester_pulls` (
22
`id` int(11) NOT NULL AUTO_INCREMENT,
33
`pull_id` int(11) NOT NULL,
44
`title` varchar(200) NOT NULL,
5-
`description` varchar(5000) NOT NULL DEFAULT '',
5+
`description` varchar(150) NOT NULL DEFAULT '',
66
`pull_url` varchar(255) NOT NULL,
77
PRIMARY KEY (`id`)
88
) DEFAULT CHARSET=utf8;

administrator/components/com_patchtester/install/sql/postgresql/install.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CREATE TABLE IF NOT EXISTS "#__patchtester_pulls" (
22
"id" serial NOT NULL,
33
"pull_id" bigint NOT NULL,
44
"title" character varying(200) NOT NULL,
5-
"description" character varying(5000) DEFAULT '' NOT NULL,
5+
"description" character varying(150) DEFAULT '' NOT NULL,
66
"pull_url" character varying(255) NOT NULL,
77
PRIMARY KEY ("id")
88
);

administrator/components/com_patchtester/install/sql/sqlsrv/install.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CREATE TABLE [#__patchtester_pulls] (
22
[id] [bigint] IDENTITY(1,1) NOT NULL,
33
[pull_id] [bigint] NOT NULL,
44
[title] [nvarchar](200) NOT NULL,
5-
[description] [nvarchar](4000) NOT NULL DEFAULT '',
5+
[description] [nvarchar](150) NOT NULL DEFAULT '',
66
[pull_url] [nvarchar](255) NOT NULL,
77
CONSTRAINT [PK_#__patchtester_pulls] PRIMARY KEY CLUSTERED
88
(

administrator/templates/hathor/html/com_patchtester/pulls/default_items.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<?php echo $item->pull_id; ?>
2222
</td>
2323
<td>
24-
<p class="hasTooltip" title="<?php echo $this->escape(\JHtml::_('string.truncateComplex', $item->description, 100)); ?>">
24+
<p class="hasTooltip" title="<?php echo $this->escape($item->description); ?>">
2525
<?php echo $this->escape($item->title); ?>
2626
</p>
2727
</td>

0 commit comments

Comments
 (0)