Issue #2793343: Dialog drupalAutoButtons option should be respected on initial load
Merge request reports
Activity
125 125 response.method = 'html'; 126 126 ajax.commands.insert(ajax, response, status); 127 127 128 // Move the buttons to the jQuery UI dialog buttons area. 129 if (!response.dialogOptions.buttons) { 128 // Move the buttons to the jQuery UI dialog buttons area, if not disabled: 129 // The renderer may have passed `false` as a string. 130 if (!response.dialogOptions.drupalAutoButtons) { 131 response.dialogOptions.drupalAutoButtons = true; 132 } 133 if (response.dialogOptions.drupalAutoButtons && response.dialogOptions.drupalAutoButtons !== 'false') { changed this line in version 3 of the diff
125 125 response.method = 'html'; 126 126 ajax.commands.insert(ajax, response, status); 127 127 128 // Move the buttons to the jQuery UI dialog buttons area. 129 if (!response.dialogOptions.buttons) { 128 // Move the buttons to the jQuery UI dialog buttons area, if not disabled: 129 // The renderer may have passed `false` as a string. 130 if (!response.dialogOptions.drupalAutoButtons) { changed this line in version 5 of the diff
added 1 commit
125 125 response.method = 'html'; 126 126 ajax.commands.insert(ajax, response, status); 127 127 128 // Move the buttons to the jQuery UI dialog buttons area. 129 if (!response.dialogOptions.buttons) { 128 // Move the buttons to the jQuery UI dialog buttons area, if not disabled: 129 // The renderer may have passed `false` as a string. 130 if (!response.dialogOptions.drupalAutoButtons) { Why would you do this? If
response.dialogOptions.drupalAutoButton
is0
/'0'
/false
, you set it totrue
?Better to change this line to
typeof response.dialogOptions.drupalAutoButtons === 'undefined'
, which I assume is the case you want to cover ...Best case would be to force a boolean value by
response.dialogOptions.drupalAutoButtons = response.dialogOptions.drupalAutoButtons === 'false' ? false : !!response.dialogOptions.drupalAutoButtons;
right before theif
condition, which should only containresponse.dialogOptions.buttons
Well, when I think about, this does not cover the undefined case, so it should be
response.dialogOptions = response.dialogOptions || {}; // Move the buttons to the jQuery UI dialog buttons area. if (typeof response.dialogOptions.drupalAutoButtons === 'undefined') { response.dialogOptions.drupalAutoButton = true; } else if (response.dialogOptions.drupalAutoButtons === 'false') { response.dialogOptions.drupalAutoButton = false; } else { // Force boolean value. response.dialogOptions.drupalAutoButton = !!response.dialogOptions.drupalAutoButton; } if (response.dialogOptions.drupalAutoButtons) { response.dialogOptions.buttons = Drupal.behaviors.dialog.prepareDialogButtons($dialog); }
Edited by Daniel Kulbechanged this line in version 5 of the diff
added 1 commit
- 2944f800 - Applied changes suggested by @DanielKulbe, fixing typos. Added automated tests.
@DanielKulbe's suggestions look right to me, although there are typos: "drupalAutoButton" should be "drupalAutoButtons", unless I'm missing something.
Latest commit applied @DanielKulbe's changes, fixes typos, adds automated tests, and was checked with "commit-code-check.sh".
added 1197 commits
-
2944f800...b7e8bd49 - 1046 commits from branch
project:9.3.x
- 577a6344 - Drupal 9.4.x-dev
- 4063e76c - Issue #3186992 by hinal05, djsagar, kiran.kadam911, hitvika_verma,...
- f4ff1b59 - Issue #3214170 by Sakthivel M, manojithape, mitthukumawat, tushar_sachdeva:...
- a9113534 - Issue #3246053 by quietone: Fix file_managed table for ds9.txt
- b3a30bae - Issue #3227821 by wtrv: Broken svg element with "Auto convert linebreaks" (autop) filter
- 4c20b339 - Issue #3038596: Mechanism that adds custom drupalci.yml configurations does...
- f5fdfe31 - Issue #2569381 by alx_benjamin, init90, vasi, deepakaryan1988,...
- 8512e0e9 - Issue #3213644 by Beakerboy, daffie:...
- 10ca9797 - Issue #3246595 by andypost: Update dependencies for 9.3.x
- 055054d5 - Issue #3245820 by paul121, dww, eojthebrave: Remove references to removed node publish actions
- 9aa1d53c - Issue #3232074 by bbrala, daffie, effulgentsia, catch, gabesullice, alexpott:...
- a427549e - Revert "Issue #3232074 by bbrala, daffie, effulgentsia, catch, gabesullice,...
- 5c78c189 - Issue #3232074 by bbrala, daffie, alexpott, effulgentsia, catch, gabesullice:...
- 76b86646 - Issue #3163663 by mpp, chrisolof, alexpott, quietone: Too many open files...
- 04f25785 - Issue #3087332 by quietone, huzooka, amateescu, danflanagan8: Deprecate the...
- 0949c10c - Issue #3239509 by hooroomoo, larowlan, bnjmnm, lauriii: Add String.includes...
- 2aee2c17 - Issue #3212891 by vaish, brentgees@gmail.com, srilakshmier, mikelutz,...
- 9f6cef72 - Issue #3028837 by quietone, joachim, alexpott: views_hooks group has nothing in it
- ea01173e - Issue #3248156 by alexpott, longwave: Update dependencies prior to 9.3.0 beta
- f96b7fba - Issue #3232095 by daffie, dww, longwave, andypost, catch, larowlan: [Symfony...
- 84e8b971 - Issue #3214921 by daffie, xurizaemon, alexpott, mondrake, andypost, Taran2L,...
- b4a6273e - Issue #3231683 by daffie, longwave: [Symfony 6] A number of methods of the...
- 9e3837a2 - Issue #3158289 by alexpott, barboza: Deprecate hook_init for theme engines
- 84ef68cf - Issue #3247901 by danflanagan8, longwave: ContentTranslationUITestBase should not rely on Classy
- 55a804ce - Issue #2975461 by quietone, Matroskeen, Lendude: Convert query string to array...
- 7f6603b6 - Issue #3248600 by andypost, longwave: Update dependencies for 9.3.x
- f8a197f5 - Issue #3244621 by mherchel, rikki_iki, catch, cathwaldron, rachel_norfolk,...
- 1e05f804 - Issue #3248649 by alexpott:...
- ec87fa9b - Issue #3243041 by Gábor Hojtsy: Mark Olivero stable
- 35972c91 - Issue #3231364 by Wim Leers, lauriii, bnjmnm, webchick, xjm, tim.plunkett,...
- 9d75e740 - Issue #3247650 by Sutharsan, larowlan: Make it clear that...
- 8a4928c1 - Issue #3223233 by joachim, danflanagan8, longwave: Form to edit or add a...
- 4cbbdb2d - Issue #3247994 by NickDickinsonWilde, diqidoq: Claro's password element...
- 330473e7 - Issue #3222251 by bbrala, longwave: [November 8, 2021] Replace all isset...
- 6d39cdee - Issue #3222769 by bbrala, alexpott, longwave, Matroskeen: [November 8, 2021]...
- a83a7a78 - Issue #3231781 by longwave, mondrake, Feuerwagen, larowlan, TR, nlisgo,...
- dc51481d - Issue #3249263 by alexpott, andypost, Wim Leers: CKEditor 5 needs validate the...
- bcf1456c - Issue #3249233 by longwave: Update 9.3's Symfony 5 components to 5.4
- 65aaec60 - Issue #3249240 by alexpott, andypost, Wim Leers: HTMLRestrictionsUtilities::...
- 36f09c06 - Issue #3232131 by daffie, catch, alexpott, longwave, xjm, wouterj: [Symfony 5]...
- 926b4849 - Issue #3238860 by mstrelan, Theresa.Grannum, hooroomoo, bnjmnm, larowlan:...
- c304842b - Issue #2707163 by quietone, chishah92, jhodgdon, AndrewHD, xjm, dww,...
- 5281af28 - Issue #3248801 by daffie, rakesh.gectcr, bbrala, longwave: [Symfony 6] The...
- f4d355a2 - Issue #3248809 by daffie, larowlan: [Symfony 6] The...
- 94b94e7e - Issue #3248013 by daffie, longwave: [Symfony6] The...
- 3795c75c - Issue #3248816 by bsuttis, danflanagan8, quietone:...
- b9fd8ef3 - Issue #3248810 by daffie: [Symfony 6] The...
- 0e61d218 - Issue #3056409 by rkostov, larowlan, maximpodorov:...
- e9e5a0fe - SA-CORE-2021-011 by jbogdanski, Wim Leers, xjm, greggles, lauriii, tedbow
- 507fc5fe - Issue #3248014 by daffie, andypost: [Symfony 6] The...
- 41769241 - Issue #3250299 by daffie, longwave: [Symfony6] A number of CKEditor5 tests fail for Symfony 5.4
- 576bd754 - Issue #3207567 by Spokje, quietone, guilhermevp, yogeshmpawar, daffie,...
- 046c1863 - Issue #3221082 by Wim Leers, lauriii, bnjmnm: Build Drupal's CKEditor 5...
- d90527ba - Issue #3250263 by longwave, quietone: Remove unused test script
- 7ff9cbf0 - Issue #3032275 by alexpott, dww, bendeguz.csirmaz, tedbow: Create a...
- 1a8a51ac - Issue #3250335 by alexpott, beatrizrodrigues, paulocs, longwave:...
- 5ec9c99d - Issue #3171149 by Feuerwagen, kostyashupenko: Set article content type to use...
- bb486268 - Issue #3250349 by alexpott:...
- 4aa86df9 - Issue #3231040 by alexpott, Anul, longwave, bbrala, catch: (revert) Remove...
- afdff8f9 - Issue #3171570 by kostyashupenko, mherchel: Remove Olivero's custom...
- 7064c439 - Issue #3173770 by chr.fritsch, phenaproxima, akalam, dejan0: Allow field types...
- bfd559af - Issue #3250442 by daffie, andypost, longwave: [Symfony 6] Symfony 6 adds...
- 92836c43 - Issue #3138078 by mondrake, larowlan, longwave, xjm: [D9.3 beta - w/c Nov 8,...
- 588951bb - Issue #3250629 by paulocs, longwave: MockBuilder::setMethods is deprecated in...
- 40a0e8a2 - Issue #3250587 by lauriii, bnjmnm:...
- 266fe1a7 - Issue #3250482 by quietone, daffie: The docblock of...
- da178766 - Issue #3247414 by anagomes, Beakerboy: Incorrect docblock types for...
- 3730c17b - Issue #3184619 by neclimdul, quietone: Fix unreachable logic in UrlGenerator::getRoute
- 62e7f6aa - Issue #3250743 by alexpott, longwave: [PHP 8.1] NumberFieldTest fails
- b9a61af9 - Issue #3061074 by longwave, cilefen, chr.fritsch, acbramley, jungle, larowlan:...
- fd664f78 - Issue #2873732 by vijaycs85, GaëlG: Array to string conversion in...
- 1b9983e8 - Issue #3251000 by alexpott, andypost: Update dependencies for 9.1.x/9.2.x/9.3.x/9.4.x
- d87c168b - Issue #3238763 by longwave, Spokje, Krzysztof Domański, tstoeckler, quietone:...
- b8c9366c - Issue #3247269 by Sakthivel M, mherchel: Olivero: Alignment of primary menu...
- 567f483a - Issue #3251034 by lauriii, bnjmnm, longwave: Core Yarn watch builds CK5...
- 0893b9b2 - Issue #3214924 by catch: Increase DRUPAL_RECOMMENDED_PHP to 8.0 in Drupal 9.3 or 9.4
- d21e5db7 - Issue #3251768 by longwave: Update Symfony 5 dependencies to 5.4.0
- 773a2138 - Issue #3251625 by alexpott, Berdir: Including settings.php a second time and...
- 09c511d2 - Issue #3251891 by catch, andypost, longwave: Drupal 10 branch failures
- 2b83cffd - Issue #3198010 by mcdruid, acbramley, mstrelan, quietone, manojithape,...
- 79fbdb55 - Issue #2871357 by alexpott, kriboogh: Installer tasks using multiple batch...
- 011c3941 - Issue #2925203 by alexpott: LocaleConfigSubscriber can result in data loss during install
- f5a452bd - Issue #3239500 by hooroomoo, bnjmnm, lauriii: Add Array.includes polyfill to...
- dd103d84 - Issue #2886615 by scott_euser, clemens.tolboom, quietone, joachim, alexpott,...
- 51f7c3fe - Issue #3252214 by Spokje: Move tests for integrations between QuickEdit and...
- 10d7b48a - Issue #3251988 by vijaycs85, smccabe: Update return param of waitForText method
- ec7f2dac - Issue #3253666 by longwave, tim.plunkett: Layout Builder uses the wrong RouteObjectInterface
- 9a8c5ff7 - Issue #3253824 by juli sh, Matroskeen: Minor typo in d7_field_formatter_settings.yml comment
- 73a154ae - Issue #3253639 by tedbow, longwave:...
- 2d9eca99 - Issue #3252067 by tedbow, Spokje: Remove duplicate loading of update reports...
- b50d24c0 - Issue #3250648 by Beakerboy, daffie: Avoid comparing fields with different...
- 109863e2 - Issue #3253683 by andypost, Spokje, Gábor Hojtsy: Improve compatibility with composer 2.2
- f8d5ced5 - Issue #3213023 by thursday_bw: Improve the intelligibility of error messages...
- b1965205 - Issue #3239287 by alexpott, longwave: Fix...
- 4f3749b2 - Issue #3253568 by Spokje, paul121, rviner, longwave, alexpott, quietone:...
- 82ee07b1 - Issue #3246157 by ChrisDarke, rachel_norfolk: Add Chris Darke (ChrisDarke) as...
- fe9233cc - Issue #3246158 by rachel_norfolk, volkswagenchick: Add AmyJune Hineline...
- ef85c3b5 - Issue #3246156 by realityloop, rachel_norfolk: Add Brian Gilbert (realityloop)...
- f83161f6 - Issue #3253889 by BR0kEN, murilohp, longwave: `?check_logged_in=1` causes...
- 45c6d25c - Issue #3254403 by paulmckibben, ranjith_kumar_k_u, longwave, Lendude, cilefen:...
- bdf52138 - Issue #3080819 by beatrizrodrigues, ankithashetty, lucienchalom, quietone,...
- b6e7d698 - Issue #3248309 by danflanagan8: AssertBreadcrumbTrait should not rely on Classy
- d9bd98f6 - Issue #2652652 by dawehner, Sam152, Charlie ChX Negyesi, Manuel Garcia,...
- 7227fd43 - Issue #3251125 by Beakerboy, daffie, mondrake: Do not uninstall the database...
- 3ffca336 - Issue #3245383 by Beakerboy, daffie: If the database driver is provided by a...
- d0be0af7 - Issue #3186524 by longwave, alexpott, xjm, Spokje: Fix htaccess files for PHP 8
- 26ec0043 - Issue #3064890 by danflanagan8, mpp, mottihoresh, scott_euser, peonboyos,...
- 2030a5bb - Issue #3248454 by daffie, Spokje, longwave, larowlan, alexpott: [Symfony6] The...
- af29dfe9 - Issue #3255836 by alexpott, clayfreeman, dww, benjifisher, Spokje: Test fails due to Composer 2.2
- 5b9b5be2 - Issue #3247039 by joachim, quietone: MigrateDestinationInterface::import()...
- cce6f01f - Issue #2793169 by Matroskeen, Manuel Garcia, anmolgoyal74, Pooja Ganjage,...
- 2a5f29ee - Issue #3205909 by kunal.sachdev, tedbow, phenaproxima: Ensure only needed...
- 62dc0bc4 - Issue #3092430 by quietone, shrutidkadam, RdeBoer, bgprior, danflanagan8:...
- 79745314 - Issue #3199696 by bbrala, Wim Leers, plach, bradjones1, gabesullice: Add...
- 1f8bcfdb - Issue #2675006 by danflanagan8, robpowell, quietone: Write UnitTest for...
- 1d4766cd - Issue #3212470 by JeroenT, Gauravmahlawat: Placeholder CSS selector in...
- fa36f859 - Issue #2675006 by danflanagan8, robpowell, quietone, alexpott: Write UnitTest...
- d2a903bb - Issue #3136388 by dww, jyotimishra-developer, nitesh624: Fix phpdocs in...
- bbc518ad - Issue #3251100 by NickDickinsonWilde: DateTimeWidgetBase sets Timezone twice to the same value
- da50a859 - Issue #3245622 by dww, mgifford, darvanen, AaronMcHale, Antoniya, anagomes,...
- bd858c23 - Issue #3252872 by bbrala, gabesullice, bradjones1, alexpott: Use...
- 45b4d536 - Issue #3153455 by Berdir, larowlan, Eduardo Morales Alberti, Gauravmahlawat,...
- c18f8d69 - Issue #3129043 by mondrake, daffie, ankithashetty, ravi.shankar, alexpott,...
- 4f4f390b - Issue #3255623 by Spokje, alexpott: Remove composer replace statements for...
- b7b2a8be - Issue #3049048 by danflanagan8, ndobromirov, mglaman, bbrala, alexpott, Wim...
- cddccd7d - Issue #3255504 by anagomes, Chi, cilefen: Remove jQuery dependency from date.js
- 61a44d1b - Issue #3131348 by Spokje, jungle, mondrake, vsujeetkumar, sja112,...
- b4520100 - Issue #3256451 by alexpott, mikelutz: Fix composer.lock hash on Drupal 9.4
- fbcea5f2 - Issue #3197553 by beatrizrodrigues, longwave, daffie: Deprecate drupal_js_defaults()
- dbca2fc0 - Issue #3251835 by beatrizrodrigues, joachim, mikelutz, quietone: Fix incorrect...
- 7aa1ef1d - Issue #3249859 by apaderno: The documentation page for...
- 8417e5ff - Issue #3246471 by apaderno, dagmar, vicheldt: Remove from the DbLogController...
- 4e4f76c9 - Issue #2940121 by apaderno, andypost, idebr, Kingdutch, kala4ek, mfb,...
- 3310654e - Issue #3210129 by quietone, murilohp, xjm: Fix spelling for words used once,...
- 038c7dd5 - Issue #3256518 by Spokje: Remove drupal_js_defaults() in D10 instead of D11
- ca7158d4 - Issue #3174570 by quietone, anmolgoyal74, skudderk: Fix documentation comment...
- 9a28ddce - Issue #3185269 by mondrake, daffie, alexpott, andypost: Introduce...
- 9caf7d9a - Issue #3175287 by murilohp, quietone, SivaprasadC, ankithashetty,...
- 88868d81 - Issue #3042533 by quietone, danflanagan8: D6 taxonomy term fields are not...
- 697c1d8d - Issue #3190541 by tim.plunkett, godotislate, clayfreeman:...
- 2ea9f648 - Issue #2853183 by quietone, darvanen, slootjes, Munavijayalakshmi,...
- ca21c4b9 - Issue #2343517 by joelpittet, quietone, rteijeiro, andypost: Cleanup @todo...
- 1b1d4571 - Issue #2610520 by quietone, snehi, MiSc, hansfn, Ben Coleman, Antoniya:...
- b00f2733 - Issue #3256581 by cburschka: PHPdoc in update.authorize.inc
- 8f30563f - Issue #3240109 by edurenye, quietone: When using MigrateProcessInterface some...
- e0aa7836 - Update dialog.ajax.es6.js
- b9dcdf00 - Handle string `false`
- a2f7bd08 - Remove the todo
- d6cbfd66 - Applied changes suggested by @DanielKulbe, fixing typos. Added automated tests.
- 2d0b5640 - Merge branch '2793343-drupalAutoButtons' of...
- 6e5315d5 - Fixed typo - drupalAutoButton should be drupalAutoButtons
Toggle commit list-
2944f800...b7e8bd49 - 1046 commits from branch