Issue #3223022 reroll of StryKaizer's "discard changes" dialog in the...
5 open threads
Merge request reports
Activity
added 1 commit
- eb3fd5d3 - Use AjaxResponse and CloseModalDialogCommand on Discard and Revert
added 1 commit
- b17e6022 - Fix code quality - space found before square bracket
added 1 commit
- 0c3e84c5 - Updated tests by changing pressButton to clickLink according to the implementations in MR.
189 ], 190 '#submit' => [ 191 [$this, 'submitRevertDefaults'], 192 ], 177 193 ]; 194 178 195 return $actions; 179 196 } 180 197 198 /** 199 * Ajax callback to cancel discard changes. 200 * 201 * @return \Drupal\Core\Ajax\AjaxResponse 202 * An ajax response object. 203 */ 204 public function ajaxCallbackDiscardChanges() { changed this line in version 10 of the diff
207 $settings = [ 208 'title' => $this->t('Discard changes'), 209 'modal' => TRUE, 210 'resizable' => TRUE, 211 ]; 212 $command = new OpenModalDialogWithUrl($url->toString(), 213 $settings); 214 $response->addCommand($command); 215 216 return $response; 217 } 218 219 /** 220 * Non Ajax redirect to discard changes form. 221 */ 222 public function submitDiscardChanges(array $form, FormStateInterface $form_state) { changed this line in version 11 of the diff
221 */ 222 public function submitDiscardChanges(array $form, FormStateInterface $form_state) { 223 // Generate the URL using the sectionStorage's getLayoutBuilderUrl method. 224 $url = $this->sectionStorage->getLayoutBuilderUrl('discard_changes'); 225 226 // Set the redirect to the generated "Discard changes" page. 227 $form_state->setRedirectUrl($url); 228 } 229 230 /** 231 * Ajax callback to Revert defaults . 232 * 233 * @return \Drupal\Core\Ajax\AjaxResponse 234 * An ajax response object. 235 */ 236 public function ajaxCallbackRevertDefaults() { changed this line in version 12 of the diff
241 'modal' => TRUE, 242 'resizable' => TRUE, 243 ]; 244 $command = new OpenModalDialogWithUrl($url->toString(), 245 $settings); 246 $response->addCommand($command); 247 248 return $response; 249 } 250 251 /** 252 * Non Ajax redirect to "Revert defaults" form. 253 * 254 * We need this one if our javascript doesn't work for some reason. 255 */ 256 public function submitRevertDefaults(array $form, FormStateInterface $form_state) { changed this line in version 13 of the diff
186 202 /** 187 203 * Provides test data for ::testNoLayoutSave(). 188 204 */ 189 public static function layoutNoSaveProvider() { 205 public static function layoutNoSaveProvider():array { changed this line in version 14 of the diff
Hi @smustgrave! I've applied all your suggestions to the patch. However, I reviewed other Drupal core code and found only a few places where the same approach is used, i mean, the return type declarations for class methods and functions.
Might be we should consider raising another ticket about this return type declaration issue?
added 104 commits
-
4a28875a...83d68bd7 - 102 commits from branch
project:11.x
- fdabd1a3 - Merge remote-tracking branch 'origin/11.x' into 3223022-modal-discard-dialog
- 0316728b - Rollback layoutNoSaveProvider function type declaration
-
4a28875a...83d68bd7 - 102 commits from branch
added 62 commits
-
0316728b...9258113b - 61 commits from branch
project:11.x
- 4d77e19d - Merge branch drupal:11.x into 3223022-modal-discard-dialog
-
0316728b...9258113b - 61 commits from branch
added 73 commits
-
4d77e19d...4548e070 - 72 commits from branch
project:11.x
- 78921c5e - Merge branch '11.x' of github.com:drupal/drupal into 3223022-modal-discard-dialog
-
4d77e19d...4548e070 - 72 commits from branch
added 438 commits
-
ff7b6ec3...cbdeab5c - 437 commits from branch
project:11.x
- c279f17a - Merge branch '11.x' of github.com:drupal/drupal into 3223022-modal-discard-dialog
-
ff7b6ec3...cbdeab5c - 437 commits from branch
added 343 commits
-
c279f17a...622e3cc1 - 342 commits from branch
project:11.x
- 9629fa1c - Merge branch '11.x' into 3223022-modal-discard-dialog
-
c279f17a...622e3cc1 - 342 commits from branch
Please register or sign in to reply