Skip to content

Commit 3f76a0d

Browse files
committed
Merge branch 'master' into beta
* master: Update POT files using the production database Fix string to make it properly translatable Update translations from Transifex Update xgettext-js to 3.0.0 Update babel and associated plugins MBS-11722: Don't preselect basic as language proficiency (metabrainz#2145) MBS-9426: Allow removing usernames from locked list MBS-11828: Add admin page to check whether username is locked MBS-11689: Report for pseudo-releases marked as the original tracklist (metabrainz#2174) MBS-11854: Recognize unicode hyphen in guess case (metabrainz#2199) MBS-11680: Group editing URL relationships by external link (metabrainz#2114) Update HACKING to create the SELENIUM DB directly (metabrainz#2210) MBS-11832: Add missing NotFound params for artist_credit (metabrainz#2191) MBS-11693: Give useful message when rejecting Musixmatch /album links (metabrainz#2126) MBS-11848: Add report for releases with Amazon cover art without CAA cover (metabrainz#2197) MBS-7859: Hide irrelevant recording rels from release view (metabrainz#2194) Fix deprecated link type code + tests (metabrainz#2211) Use the $DIRECTION_FORWARD constant in place of 1 MBS-11856: Remove reports for releases with cover art relationships (metabrainz#2202) MBS-11862: Do not show deprecated relationship types with 0 uses (metabrainz#2206) MBS-11825: Use same order for art types when editing vs adding (metabrainz#2203) Remove reporter id from report message-id (metabrainz#2208) MBS-2221: Add date docs to relationship editor (metabrainz#2204) MBS-11861: improve loopParity classes for tablesorter (metabrainz#2205) (Re-)Add InformationIcon to components.js MBS-11863: Allow DNB links for works MBS-11864: Some DNB links are wrongly marked as invalid Allow declaring my $edit twice MBS-2418: Show Edit URL edits in entity edit histories MBS-11267: Always show artwork info when adding/reordering (metabrainz#1821) MBS-11798: Disallow Instagram internal links (metabrainz#2179) Fix typo (seriess -> series) Use q/qq to avoid escaping quotes for readability Move eslint-plugin-fb-flow to devDependencies Add eslint-plugin-fb-flow; fixed use-indexed-access-type Bump Flow to 0.157.0 Bump Flow to 0.156.0 Import Input/Output without passing through gc and drop gc.mode Fix Perl::Critic space at end of line errors on tests Fix Perl::Critic useless interpolation errors on tests Fix eslint sort-keys MBS-11850: Make footer links more visible Make most of GuessCaseT read-only Add flow types to guess-case/modes Clarify variable names Fix sort-keys issues Make fixEnglishKeyNames directly part of runPostProcess Replace Object.assign with spread Remove useless type declarations MBS-11824: Don't require space after feat. in reports MBS-11833: Drop "f." from the featured artists reports Add flow types to guess-case/Output Simplify appendWordPreserveWhiteSpace Clarify variable names Use .push to append to array Improve some comments, remove some useless ones Remove unused output.dropLastWord Clarify variable name: _w -> wordList Remove seemingly unused _output variable Fix eslint issues in GuessCaseOutput Convert GuessCaseOutput to class Add flow types to guess-case/Input Avoid negative null check in capitalizeCurrentWord Drop unneeded and misleading comment Remove unused insertWordAtEnd, simplify updateCurrentWord Drop unneeded wordListLength variable Drop self-explanatory / wrong comments, update others Clarify getCursorPosition / setCursorPosition Clarify variable names in GuessCaseInput Fix eslint issues in GuessCaseInput Convert GuessCaseInput to class More self-explanatory variable names for guess case MBS-11805: Add basic flow types to guess-case/utils MBS-11802: Add mock LinkType for examples (metabrainz#2181) MBS-11793: Don't fetch Wikipedia abstract when URL is ended (metabrainz#2178) MBS-11806: Don't group relationships for different track sets (metabrainz#2186) MBS-11796: Add Internet Archive logo for sidebar (metabrainz#2176) MBS-11808: Don't show tags in lists where vote count < 1 (metabrainz#2188) Reject adding entities on search for all types that do not support it Fix autocomplete2 editor search MBS-11811: Do not batch-change track data for collapsed media Rename guessCaseMediaNames (it guesses tracks too) MBS-11812: Fix missing whitespace before "New medium title" MBS-11810: disc title should be medium title MBS-11805: Add flow types to guess-case/flags const over var for flags.js Sort keys Typo: hypen -> hyphen MBS-11797: Lowercase "censored", "uncensored", "explicit" in ETI MBS-11788: Guess case: Lowercase "official" in ETI MBS-11391: Add a dedicated popover to edit URL (metabrainz#2151) MBS-11760: Improve testing for tag autodeletion MBS-11760: Add missing delete_unused_tag triggers MBS-11733: Remove WikiaParoles from lyrics whitelist MBS-11732: Remove LYRICSnMUSIC from lyrics whitelist
2 parents 84ecfe8 + 4765fed commit 3f76a0d

File tree

391 files changed

+14491
-7544
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

391 files changed

+14491
-7544
lines changed

.eslintrc.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ plugins:
66
- import
77
- react
88
- flowtype
9+
- fb-flow
910
- react-hooks
1011

1112
env:
@@ -333,6 +334,12 @@ rules:
333334
flowtype/union-intersection-spacing: [warn, always]
334335
flowtype/use-flow-type: warn
335336

337+
#########################
338+
# eslint-plugin-fb-flow #
339+
#########################
340+
341+
fb-flow/use-indexed-access-type: error
342+
336343
#############################
337344
# eslint-plugin-react-hooks #
338345
#############################

HACKING.md

+1-7
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,7 @@ These are a bit more involved to set up:
212212

213213
* Set USE_SET_DATABASE_HEADER to 1 in lib/DBDefs.pm.
214214

215-
* Run ./script/create_test_db.sh and ./script/compile_resources.sh again.
216-
217-
* Create the `musicbrainz_selenium` database using `musicbrainz_test` as
218-
a template:
219-
220-
$ # On Ubuntu, use sudo -u postgres
221-
$ createdb -O musicbrainz -T musicbrainz_test -U postgres musicbrainz_selenium
215+
* Run ./script/create_test_db.sh SELENIUM and run ./script/compile_resources.sh again.
222216

223217
With the above prerequisites out of the way, the tests can be run from the
224218
command line like so:

admin/GenerateSQLScripts.pl

+3-3
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,9 @@ sub process_tables
223223
print OUT "BEGIN;\n\n";
224224
foreach my $row (@replication_triggers) {
225225
my ($table, $verbose) = @$row;
226-
print OUT "CREATE TRIGGER \"reptg_$table\"\n";
227-
print OUT "AFTER INSERT OR DELETE OR UPDATE ON \"$table\"\n";
228-
print OUT "FOR EACH ROW EXECUTE PROCEDURE \"recordchange\" (" . ($verbose ? "'verbose'" : "") . ");\n\n"
226+
print OUT qq(CREATE TRIGGER "reptg_$table"\n);
227+
print OUT qq(AFTER INSERT OR DELETE OR UPDATE ON "$table"\n);
228+
print OUT 'FOR EACH ROW EXECUTE PROCEDURE "recordchange" (' . ($verbose ? "'verbose'" : "") . ");\n\n"
229229
}
230230
print OUT "COMMIT;\n";
231231
close OUT;

admin/InitDb.pl

+4-4
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ sub CreateReplicationFunction
148148

149149
$sql->auto_commit;
150150
$sql->do(
151-
"CREATE FUNCTION \"recordchange\" () RETURNS trigger
152-
AS ?, 'recordchange' LANGUAGE C",
151+
q(CREATE FUNCTION "recordchange" () RETURNS trigger
152+
AS ?, 'recordchange' LANGUAGE C),
153153
$path_to_pending_so,
154154
);
155155
}
@@ -260,7 +260,7 @@ sub CreateRelations
260260
my $opts = $DB->shell_args;
261261
$ENV{"PGPASSWORD"} = $DB->password;
262262

263-
system(sprintf("echo \"CREATE SCHEMA %s\" | $psql $opts", $_))
263+
system(sprintf(qq(echo "CREATE SCHEMA %s" | $psql $opts), $_))
264264
for (qw(
265265
musicbrainz
266266
cover_art_archive
@@ -384,7 +384,7 @@ sub CreateRelations
384384
print localtime() . " : Optimizing database ...\n" unless $fQuiet;
385385
$opts = $DB->shell_args;
386386
$ENV{"PGPASSWORD"} = $DB->password;
387-
system("echo \"vacuum analyze\" | $psql $opts");
387+
system(qq(echo "vacuum analyze" | $psql $opts));
388388
die "\nFailed to optimize database\n" if ($? >> 8);
389389

390390
print localtime() . " : Initialized and imported data into the database.\n" unless $fQuiet;

admin/NormalizeToHTTPS

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use lib "$FindBin::Bin/../lib";
99
use MusicBrainz::Server::Context;
1010
use MusicBrainz::Server::Validation qw( is_positive_integer );
1111

12-
my $usage = "\"Usage: $0 number_of_rows domain.name [domain.name ...]\"";
12+
my $usage = qq("Usage: $0 number_of_rows domain.name [domain.name ...]");
1313

1414
my $number_of_rows = shift;
1515
is_positive_integer($number_of_rows) or warn $usage and die "invalid number of rows";

admin/sql/CreateTriggers.sql

+20-4
Original file line numberDiff line numberDiff line change
@@ -1036,34 +1036,50 @@ CREATE CONSTRAINT TRIGGER delete_unused_tag
10361036
AFTER INSERT ON tag DEFERRABLE INITIALLY DEFERRED
10371037
FOR EACH ROW EXECUTE PROCEDURE trg_delete_unused_tag();
10381038

1039+
CREATE CONSTRAINT TRIGGER delete_unused_tag
1040+
AFTER DELETE ON area_tag DEFERRABLE INITIALLY DEFERRED
1041+
FOR EACH ROW EXECUTE PROCEDURE trg_delete_unused_tag_ref();
1042+
10391043
CREATE CONSTRAINT TRIGGER delete_unused_tag
10401044
AFTER DELETE ON artist_tag DEFERRABLE INITIALLY DEFERRED
10411045
FOR EACH ROW EXECUTE PROCEDURE trg_delete_unused_tag_ref();
10421046

1047+
CREATE CONSTRAINT TRIGGER delete_unused_tag
1048+
AFTER DELETE ON event_tag DEFERRABLE INITIALLY DEFERRED
1049+
FOR EACH ROW EXECUTE PROCEDURE trg_delete_unused_tag_ref();
1050+
1051+
CREATE CONSTRAINT TRIGGER delete_unused_tag
1052+
AFTER DELETE ON instrument_tag DEFERRABLE INITIALLY DEFERRED
1053+
FOR EACH ROW EXECUTE PROCEDURE trg_delete_unused_tag_ref();
1054+
10431055
CREATE CONSTRAINT TRIGGER delete_unused_tag
10441056
AFTER DELETE ON label_tag DEFERRABLE INITIALLY DEFERRED
10451057
FOR EACH ROW EXECUTE PROCEDURE trg_delete_unused_tag_ref();
10461058

10471059
CREATE CONSTRAINT TRIGGER delete_unused_tag
1048-
AFTER DELETE ON release_group_tag DEFERRABLE INITIALLY DEFERRED
1060+
AFTER DELETE ON place_tag DEFERRABLE INITIALLY DEFERRED
10491061
FOR EACH ROW EXECUTE PROCEDURE trg_delete_unused_tag_ref();
10501062

10511063
CREATE CONSTRAINT TRIGGER delete_unused_tag
1052-
AFTER DELETE ON work_tag DEFERRABLE INITIALLY DEFERRED
1064+
AFTER DELETE ON recording_tag DEFERRABLE INITIALLY DEFERRED
10531065
FOR EACH ROW EXECUTE PROCEDURE trg_delete_unused_tag_ref();
10541066

10551067
CREATE CONSTRAINT TRIGGER delete_unused_tag
1056-
AFTER DELETE ON area_tag DEFERRABLE INITIALLY DEFERRED
1068+
AFTER DELETE ON release_group_tag DEFERRABLE INITIALLY DEFERRED
10571069
FOR EACH ROW EXECUTE PROCEDURE trg_delete_unused_tag_ref();
10581070

10591071
CREATE CONSTRAINT TRIGGER delete_unused_tag
1060-
AFTER DELETE ON instrument_tag DEFERRABLE INITIALLY DEFERRED
1072+
AFTER DELETE ON release_tag DEFERRABLE INITIALLY DEFERRED
10611073
FOR EACH ROW EXECUTE PROCEDURE trg_delete_unused_tag_ref();
10621074

10631075
CREATE CONSTRAINT TRIGGER delete_unused_tag
10641076
AFTER DELETE ON series_tag DEFERRABLE INITIALLY DEFERRED
10651077
FOR EACH ROW EXECUTE PROCEDURE trg_delete_unused_tag_ref();
10661078

1079+
CREATE CONSTRAINT TRIGGER delete_unused_tag
1080+
AFTER DELETE ON work_tag DEFERRABLE INITIALLY DEFERRED
1081+
FOR EACH ROW EXECUTE PROCEDURE trg_delete_unused_tag_ref();
1082+
10671083
--------------------------------------------------------------------------------
10681084
CREATE CONSTRAINT TRIGGER apply_artist_release_group_pending_updates
10691085
AFTER INSERT OR UPDATE OR DELETE ON release DEFERRABLE INITIALLY DEFERRED

admin/sql/DropTriggers.sql

+7-3
Original file line numberDiff line numberDiff line change
@@ -314,13 +314,17 @@ DROP TRIGGER url_gc_a_del_l_url_url ON l_url_url;
314314
DROP TRIGGER url_gc_a_upd_l_url_work ON l_url_work;
315315
DROP TRIGGER url_gc_a_del_l_url_work ON l_url_work;
316316
DROP TRIGGER delete_unused_tag ON tag;
317+
DROP TRIGGER delete_unused_tag ON area_tag;
317318
DROP TRIGGER delete_unused_tag ON artist_tag;
319+
DROP TRIGGER delete_unused_tag ON event_tag;
320+
DROP TRIGGER delete_unused_tag ON instrument_tag;
318321
DROP TRIGGER delete_unused_tag ON label_tag;
322+
DROP TRIGGER delete_unused_tag ON place_tag;
323+
DROP TRIGGER delete_unused_tag ON recording_tag;
319324
DROP TRIGGER delete_unused_tag ON release_group_tag;
320-
DROP TRIGGER delete_unused_tag ON work_tag;
321-
DROP TRIGGER delete_unused_tag ON area_tag;
322-
DROP TRIGGER delete_unused_tag ON instrument_tag;
325+
DROP TRIGGER delete_unused_tag ON release_tag;
323326
DROP TRIGGER delete_unused_tag ON series_tag;
327+
DROP TRIGGER delete_unused_tag ON work_tag;
324328
DROP TRIGGER apply_artist_release_group_pending_updates ON release;
325329
DROP TRIGGER apply_artist_release_pending_updates ON release;
326330
DROP TRIGGER apply_artist_release_pending_updates ON release_country;
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
\set ON_ERROR_STOP 1
2+
3+
BEGIN;
4+
5+
CREATE CONSTRAINT TRIGGER delete_unused_tag
6+
AFTER DELETE ON event_tag DEFERRABLE INITIALLY DEFERRED
7+
FOR EACH ROW EXECUTE PROCEDURE trg_delete_unused_tag_ref();
8+
9+
CREATE CONSTRAINT TRIGGER delete_unused_tag
10+
AFTER DELETE ON place_tag DEFERRABLE INITIALLY DEFERRED
11+
FOR EACH ROW EXECUTE PROCEDURE trg_delete_unused_tag_ref();
12+
13+
CREATE CONSTRAINT TRIGGER delete_unused_tag
14+
AFTER DELETE ON recording_tag DEFERRABLE INITIALLY DEFERRED
15+
FOR EACH ROW EXECUTE PROCEDURE trg_delete_unused_tag_ref();
16+
17+
CREATE CONSTRAINT TRIGGER delete_unused_tag
18+
AFTER DELETE ON release_tag DEFERRABLE INITIALLY DEFERRED
19+
FOR EACH ROW EXECUTE PROCEDURE trg_delete_unused_tag_ref();
20+
21+
COMMIT;

lib/MusicBrainz/Script/JSONDump/Full.pm

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ has force_update_entity_types => (
3030
cmd_flag => 'force-update',
3131
documentation => ('force-update entities of this type in its ' .
3232
'json_dump.${entity}_json table; by default, ' .
33-
'entities are only inserted where they don\'t ' .
33+
q(entities are only inserted where they don't ) .
3434
'exist, and updates are done by the incremental ' .
3535
'dump only. can specify multiple of this flag ' .
3636
'(default: no force-updates)'),
@@ -118,7 +118,7 @@ sub run_impl {
118118
}
119119

120120
unless (defined $dump_replication_sequence) {
121-
die 'Couldn\'t determine which replication sequence to dump. ' .
121+
die q(Couldn't determine which replication sequence to dump. ) .
122122
'Is the replication_control table empty?';
123123
}
124124

lib/MusicBrainz/Script/JSONDump/Incremental.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ sub run_impl {
144144
my $full_replication_sequence = $c->sql->select_single_value(
145145
'SELECT full_json_dump_replication_sequence FROM json_dump.control');
146146

147-
die 'The incremental script can\'t run until a full dump has run at least once.'
147+
die q(The incremental script can't run until a full dump has run at least once.)
148148
unless defined $full_replication_sequence;
149149

150150
$self->packet_limit(1);

lib/MusicBrainz/Script/RemoveExpiredSessions.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ sub run {
5252
my $r = $store->_connection;
5353
my $now = time + 5; # five seconds grace period for server differences
5454

55-
printf "Fetching entries from database; prefix used is \"%s\".\n", $store->_namespace if $self->verbose;
55+
printf qq(Fetching entries from database; prefix used is "%s".\n), $store->_namespace if $self->verbose;
5656
my @keys = $r->_connection->keys($store->_namespace . "expires:*");
5757
# KEYS is very heavy, but our current Redis doesn't have SCAN
5858
my $considered = scalar @keys;

lib/MusicBrainz/Server/Controller/Account.pm

+3-3
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ sub verify_email : Path('/verify-email') ForbiddenOnSlaves DenyWhenReadonly
119119
current_view => 'Node',
120120
component_path => 'account/EmailVerificationStatus',
121121
component_props => {
122-
message => l('The user with ID \'{user_id}\' could not be found.',
122+
message => l(q(The user with ID '{user_id}' could not be found.),
123123
{ user_id => $user_id }),
124124
}
125125
);
@@ -200,7 +200,7 @@ sub lost_password : Path('/lost-password') ForbiddenOnSlaves SecureForm
200200
$form->field('email')->add_error(l('There is no user with this username and email'));
201201
}
202202
elsif (!$editor->email) {
203-
$form->field('email')->add_error(l('We can\'t send a password reset email, because we have no email on record for this user.'));
203+
$form->field('email')->add_error(l(q(We can't send a password reset email, because we have no email on record for this user.)));
204204
}
205205
else {
206206
$self->_send_password_reset_email($c, $editor);
@@ -279,7 +279,7 @@ sub reset_password : Path('/reset-password') ForbiddenOnSlaves DenyWhenReadonly
279279
current_view => 'Node',
280280
component_path => 'account/ResetPasswordStatus',
281281
component_props => {
282-
message => l('The user with ID \'{user_id}\' could not be found.',
282+
message => l(q(The user with ID '{user_id}' could not be found.),
283283
{ user_id => $editor_id }),
284284
}
285285
);

lib/MusicBrainz/Server/Controller/Admin.pm

+59
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use Try::Tiny;
55
BEGIN { extends 'MusicBrainz::Server::Controller' };
66

77
use MusicBrainz::Server::Translation qw(l ln );
8+
use MusicBrainz::Server::Data::Utils qw( boolean_to_json );
89

910
sub edit_user : Path('/admin/user/edit') Args(1) RequireAuth HiddenOnSlaves SecureForm
1011
{
@@ -202,6 +203,64 @@ sub ip_lookup : Path('/admin/ip-lookup') Args(1) RequireAuth(account_admin) Hidd
202203
);
203204
}
204205

206+
sub locked_username_search : Path('/admin/locked-usernames/search') Args(0) RequireAuth(account_admin) HiddenOnSlaves {
207+
my ($self, $c) = @_;
208+
209+
my $form = $c->form(form => 'Admin::LockedUsernameSearch');
210+
my @results;
211+
my $show_results = 0;
212+
213+
if ($c->form_posted_and_valid($form, $c->req->body_params)) {
214+
try {
215+
@results = $c->model('Editor')->search_old_editor_names(
216+
$form->field('username')->value // '',
217+
$form->field('use_regular_expression')->value,
218+
);
219+
$show_results = 1;
220+
} catch {
221+
my $error = $_;
222+
if ("$error" =~ m/invalid regular expression/) {
223+
$form->field('username')->add_error(l('Invalid regular expression.'));
224+
$c->response->status(400);
225+
} else {
226+
die $error;
227+
}
228+
};
229+
}
230+
231+
$c->stash(
232+
current_view => 'Node',
233+
component_path => 'admin/LockedUsernameSearch',
234+
component_props => {
235+
form => $form->TO_JSON,
236+
@results ? (results => \@results) : (),
237+
showResults => boolean_to_json($show_results),
238+
},
239+
);
240+
}
241+
242+
sub unlock_username : Path('/admin/locked-usernames/unlock') Args(1) RequireAuth(account_admin) HiddenOnSlaves {
243+
my ($self, $c, $username) = @_;
244+
245+
my $form = $c->form(form => 'SecureConfirm');
246+
247+
if ($c->form_posted_and_valid($form)) {
248+
$c->model('MB')->with_transaction(sub {
249+
$c->model('Editor')->unlock_old_editor_name($username);
250+
});
251+
$c->response->redirect($c->uri_for_action('/admin/locked_username_search'));
252+
}
253+
254+
$c->stash(
255+
current_view => 'Node',
256+
component_path => 'admin/LockedUsernameUnlock',
257+
component_props => {
258+
form => $form->TO_JSON,
259+
username => $username,
260+
},
261+
);
262+
}
263+
205264
1;
206265

207266
=head1 COPYRIGHT AND LICENSE

lib/MusicBrainz/Server/Controller/Edit.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ sub search : Path('/search/edits')
240240
quality => [ [$QUALITY_LOW => N_l('Low')], [$QUALITY_NORMAL => N_l('Normal')], [$QUALITY_HIGH => N_l('High')], [$QUALITY_UNKNOWN => N_l('Default')] ],
241241
languages => [ grep { $_->frequency > 0 } $c->model('Language')->get_all ],
242242
countries => [ $c->model('CountryArea')->get_all ],
243-
relationship_type => [ $c->model('LinkType')->get_full_tree ]
243+
relationship_type => [ $c->model('LinkType')->get_full_tree(get_deprecated_and_empty => 1) ]
244244
);
245245
return unless %{ $c->req->query_params };
246246

lib/MusicBrainz/Server/Controller/Relationship/LinkType.pm

+8-3
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ sub tree : Chained('type_specific') PathPart('')
9090
my ($self, $c) = @_;
9191

9292
my $root = $c->model('LinkType')->get_tree($c->stash->{type0},
93-
$c->stash->{type1});
93+
$c->stash->{type1},
94+
get_deprecated_and_empty => 1);
9495

9596
$c->stash(
9697
component_path => 'relationship/linktype/RelationshipTypePairTree',
@@ -127,7 +128,10 @@ sub create : Chained('type_specific') PathPart('create') RequireAuth(relationshi
127128
my $form = $c->form(
128129
form => 'Admin::LinkType',
129130
init_object => { attributes => $attribs },
130-
root => $c->model('LinkType')->get_tree($c->stash->{type0}, $c->stash->{type1})
131+
root => $c->model('LinkType')->get_tree(
132+
$c->stash->{type0},
133+
$c->stash->{type1},
134+
get_deprecated_and_empty => 1)
131135
);
132136
$form->field('parent_id')->_load_options;
133137

@@ -172,7 +176,8 @@ sub edit : Chained('load') RequireAuth(relationship_editor)
172176
orderable_direction )
173177
},
174178
root => $c->model('LinkType')->get_tree($link_type->entity0_type,
175-
$link_type->entity1_type)
179+
$link_type->entity1_type,
180+
get_deprecated_and_empty => 1)
176181
);
177182
$form->field('parent_id')->_load_options;
178183

lib/MusicBrainz/Server/Controller/Release.pm

+1
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ sub add_cover_art : Chained('load') PathPart('add-cover-art') Edit {
296296
my @mime_types = map { $_->{mime_type} } @{ $c->model('CoverArt')->mime_types };
297297

298298
my @artwork = @{ $c->model('Artwork')->find_by_release($entity) };
299+
$c->model('CoverArtType')->load_for(@artwork);
299300

300301
my $count = 1;
301302
my @positions = map {

lib/MusicBrainz/Server/Controller/Role/WikipediaExtract.pm

+3-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ sub _get_extract
4242
elsif ($_->target->isa('MusicBrainz::Server::Entity::URL::Wikidata')) { 1; }
4343
else { 0; }
4444
} grep {
45-
$_->target->isa('MusicBrainz::Server::Entity::URL::Wikipedia') ||
46-
$_->target->isa('MusicBrainz::Server::Entity::URL::Wikidata')
45+
!$_->link->{ended} &&
46+
($_->target->isa('MusicBrainz::Server::Entity::URL::Wikipedia') ||
47+
$_->target->isa('MusicBrainz::Server::Entity::URL::Wikidata'))
4748
} @{ $entity->relationships_by_link_type_names('wikipedia', 'wikidata') };
4849

4950
if (scalar @links) {

0 commit comments

Comments
 (0)