Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
weight
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
weight
Merge requests
!22
Patch
#12
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Patch
#12
issue/weight-2865716:2865716-conflict-with-bulk-operations
into
8.x-3.x
Overview
0
Commits
7
Pipelines
7
Changes
2
Open
Julian Pustkuchen
requested to merge
issue/weight-2865716:2865716-conflict-with-bulk-operations
into
8.x-3.x
7 months ago
Overview
0
Commits
7
Pipelines
7
Changes
2
Expand
Closes
#2865716
0
0
Merge request reports
Compare
8.x-3.x
version 7
d142eb12
7 months ago
version 6
de6c16f3
7 months ago
version 5
1bfb073c
7 months ago
version 4
5f52a785
7 months ago
version 3
13f07da8
7 months ago
version 2
13f07da8
7 months ago
version 1
ebbe4559
7 months ago
8.x-3.x (HEAD)
and
latest version
latest version
22ad8392
7 commits,
7 months ago
version 7
d142eb12
6 commits,
7 months ago
version 6
de6c16f3
5 commits,
7 months ago
version 5
1bfb073c
4 commits,
7 months ago
version 4
5f52a785
3 commits,
7 months ago
version 3
13f07da8
2 commits,
7 months ago
version 2
13f07da8
2 commits,
7 months ago
version 1
ebbe4559
1 commit,
7 months ago
2 files
+
20
−
3
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
src/Plugin/views/field/WeightSelector.php
+
17
−
0
Options
@@ -133,6 +133,18 @@ class WeightSelector extends FieldPluginBase {
'#value'
=>
$this
->
field
,
];
$form
[
'actions'
][
'submit_update_weight'
]
=
[
'#type'
=>
'submit'
,
'#value'
=>
$this
->
t
(
'Update order'
),
'#submit'
=>
[
[
$this
,
'viewsFormSubmit'
],
],
];
// @todo: This is still a problem, as it would also remove expected submits, e.g. from core or views_bulk_operations.
// What we need to achieve here or in the core issue (https://www.drupal.org/project/drupal/issues/3481777) is,
// that this additional button is never added for weight module itself!
unset
(
$form
[
'actions'
][
'submit'
]);
$form
[
'#action'
]
=
$this
->
requestStack
->
getCurrentRequest
()
->
getRequestUri
();
}
@@ -140,6 +152,11 @@ class WeightSelector extends FieldPluginBase {
* {@inheritdoc}
*/
public
function
viewsFormSubmit
(
array
&
$form
,
FormStateInterface
$form_state
)
{
// Ensure this is for us:
if
(
$form_state
->
getTriggeringElement
()[
'#parents'
][
0
]
??
''
!==
'submit_update_weight'
)
{
return
;
}
$field_name
=
$form_state
->
getValue
(
'views_field'
);
if
(
!
$field_name
)
{
return
;
Loading