Existing URLs in the See Also field should not throw an error when the bug is displayed

RESOLVED FIXED in Bugzilla 5.0

Status

()

Bugzilla
Creating/Changing Bugs
RESOLVED FIXED
4 years ago
2 years ago

People

(Reporter: Frédéric Buclin, Assigned: Frédéric Buclin)

Tracking

4.5.5
Bugzilla 5.0
Bug Flags:
approval5.0 +

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
If you e.g. add a URL in the See Also field which follows a regexp defined in the MoreBugUrl extension and you later disable this extension, all bugs having such URLs become unreadable and an error is thrown instead, for instance:

  undef error - Can't locate Bugzilla/Extension/MoreBugUrl/RT.pm in @INC


Instead of throwing this error, existing URLs shouldn't be validated and so no error should be thrown. You should only be forbidden to add such URLs (unless you re-enable the extension so that the regexp is listed as valid again).
(Assignee)

Comment 1

2 years ago
Created attachment 8702019 [details] [diff] [review]
patch, v1
Assignee: create-and-change → LpSolit
Status: NEW → ASSIGNED
Attachment #8702019 - Flags: review?(dkl)
(Assignee)

Updated

2 years ago
Target Milestone: --- → Bugzilla 5.0
Comment on attachment 8702019 [details] [diff] [review]
patch, v1

Review of attachment 8702019 [details] [diff] [review]:
-----------------------------------------------------------------

r=dkl

::: Bugzilla/BugUrl.pm
@@ +109,5 @@
>  
>      foreach my $object (@$objects) {
> +        eval "use " . $object->class;
> +        # If the class cannot be loaded, then we build a generic object.
> +        bless $object, $@ ? 'Bugzilla::BugUrl' : $object->class;

For a Perl newbie, it almost looks like $@ is a second argument to bless :)
Lets use parens to make it more readable maybe?

bless $object, ($@ ? 'Bugzilla::BugUrl' : $object->class);
Attachment #8702019 - Flags: review?(dkl) → review+
(Assignee)

Updated

2 years ago
Flags: approval5.0?

Updated

2 years ago
Flags: approval5.0? → approval5.0+
(Assignee)

Comment 3

2 years ago
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   f709156..7829cc8  master -> master

To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   04004a6..f729352  5.0 -> 5.0
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.