Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
best-practical
rt
Commits
d41e6a6a
Commit
d41e6a6a
authored
Sep 03, 2014
by
Kevin Falcone
Browse files
Merge branch '4.2/customfield-attributes' into 4.2-trunk
parents
7894729d
0b4296db
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
6 deletions
+23
-6
etc/upgrade/4.2.7/content
etc/upgrade/4.2.7/content
+15
-0
lib/RT/CustomField.pm
lib/RT/CustomField.pm
+8
-6
No files found.
etc/upgrade/4.2.7/content
0 → 100644
View file @
d41e6a6a
use strict;
use warnings;
our @Initial = (
sub {
# We do the delete in pure SQL because Attribute collections
# otherwise attempt to hash everything in memory. As this may
# be a large list, do it directly.
RT->DatabaseHandle->dbh->do(<<EOSQL);
DELETE FROM Attributes
WHERE (Name = 'LinkValueTo' OR Name = 'IncludeContentForValue')
AND (Content = '' OR Content IS NULL);
EOSQL
},
);
lib/RT/CustomField.pm
View file @
d41e6a6a
...
...
@@ -1968,18 +1968,20 @@ sub _URLTemplate {
unless
(
$self
->
CurrentUserHasRight
('
AdminCustomField
')
)
{
return
(
0
,
$self
->
loc
('
Permission Denied
')
);
}
$self
->
SetAttribute
(
Name
=>
$template_name
,
Content
=>
$value
);
if
(
length
$value
and
defined
$value
)
{
$self
->
SetAttribute
(
Name
=>
$template_name
,
Content
=>
$value
);
}
else
{
$self
->
DeleteAttribute
(
$template_name
);
}
return
(
1
,
$self
->
loc
('
Updated
')
);
}
else
{
unless
(
$self
->
id
&&
$self
->
CurrentUserHasRight
('
SeeCustomField
')
)
{
return
(
undef
);
}
my
@attr
=
$self
->
Attributes
->
Named
(
$template_name
);
my
$attr
=
shift
@attr
;
if
(
$attr
)
{
return
$attr
->
Content
}
my
(
$attr
)
=
$self
->
Attributes
->
Named
(
$template_name
);
return
undef
unless
$attr
;
return
$attr
->
Content
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment