Closed (fixed)
Project:
Form mode manager
Version:
8.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
11 Aug 2020 at 02:25 UTC
Updated:
6 Jul 2021 at 00:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
alvarito75 commentedComment #3
sahana _n commentedThe patch applied cleanly.
Comment #4
scott_euser commentedThis patch no longer applies to 2.x-dev, updated patch, fixes a couple more issues introduced since then.
Tested by enabling the module, adding a form mode, adding that form mode to core article type, updating the form display settings, and then editing an article in the new form mode.
Comment #5
scott_euser commentedFound one more when manually checking the help pages
Comment #6
segi commentedI have started to use patch #5. I found an error on admin/user page "Warning: strpos() expects parameter 1 to be string, object given in Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() (line 358 of /var/www/html/web/core/lib/Drupal/Component/Utility/UrlHelper.php)"
The problem was that the toUrl() gives back an URL object. Here is my fix.
Comment #7
muaz7731Tested out the patch from #6. got this:
I fix it by tweaking the file
form_mode_manager.info.ymlto add this below "core : '8.x':core_version_requirement: ^8 || ^9Tested out using contrib module Profile, and it works for me.The module that I currently using is form_mode_manager-8.x-2.0-rc3 with Drupal 9.1.3
+1 for RTBC
Comment #8
playful commentedAny chance to get a D9 ready release for this module?
Comment #9
muaz7731The patch #6 works for development build 8.x-2.x-dev
However the submodule does not work for drupal 9. I dont know if the submodule is important or not. I dont use it
https://www.drupal.org/files/issues/2021-03-01/Capture.PNG
I set this as rtbc.
Comment #10
pianomansam commented@muaz91 I would think it's inappropriate to set this as RTBC if parts of it are still not working.
Comment #11
drupalvikingI have now tested it on four different occasions with the 8.x-2.x branch and the patches work for the main module. But there is still the issue of the sub-modules, that have not been patched yet. I will take a look at it and supply a patch for that.
Comment #13
drupalvikingI applied the patch #6 to the code plus I added the core_version_requirement directive to each of the three submodules. Please review.
Comment #14
guilhermevp commentedTesting the merge request, module, sub modules and example install as they should, but I came across this error while doing some testing. Not sure if it is related to the new code, or it's an older issue but moving to needs work.
The error happened at admin/config/content/form_mode_manager/theme-switcher .
Comment #15
drupalviking@guilhermevp, is there an active theme (installed and set to default) in your test environment? If not, this error comes up.
Comment #16
drupalvikingNevermind, I can also generate it. Back to the drawing board.
Comment #19
scott_euser commentedDefinitely struggled with getting the MR in place sorry. Default UI here from drupal.org created a separate merge request but I wanted to make a MR into your branch since its not open for commits from others.
Ultimately link to it is here:
https://git.drupalcode.org/issue/form_mode_manager-3164478/-/merge_reque...
But drupal.org isn't picking it up.
Comment #20
guilhermevp commentedI was able to install in D9 and use it as intended. Seems good to me! No more errors in theme as well.
Comment #22
dwwI just applied the patch from #3140602: Automated Drupal Rector fixes, added it to this MR, and closed that issue as a duplicate.
Also marked #3110961: Make 8.x-1.x compatible with Drupal 9 as a duplicate (even though it was opened much earlier than this one) since the changes in the latest patch over there are already included with this MR. If I were a maintainer, I'd credit https://www.drupal.org/u/ankithashetty here since they worked on the D9 port originally.
Since we've got an MR and issue fork going, I'm also hiding all the patches and screenshots attached here to avoid confusion...
Meanwhile, trying to run this module's full tests against a local 9.2.x dev site, and we get:
Fatal error: Trait 'Drupal\Tests\taxonomy\Functional\TaxonomyTestTrait' not found in /Users/dww/drupal/form_mode_manager/tests/src/Functional/FormModeManagerUiTest.php on line 16I'll work on fixing that next. Stay tuned. Thanks!
Comment #23
dwwOkay, the TaxonomyTestTrait fix was pretty simple (b86f1cd) All tests are passing locally on 8.9.x now, although they were generating the following deprecation notices:
Pushed another commit to add
$defaultTheme(00a8c7cb)Also moved modules/examples/src/Tests/FormModeManagerExamplesTest.php to modules/examples/tests/src/Functional/FormModeManagerExamplesTest.php (0e8ebd86) and got that one passing on D9 (e546f167 and 622d3d90).
Also fixed "Any entity_reference_autocomplete component of an entity_form_display must have a match_limit setting" via commit 3db4051.
However, trying to run either tests/src/Functional/FormModeManagerRouteTest.php or tests/src/Functional/FormModeManagerUiTest.php is causing phpunit to seg fault. 🎉 Fun! Not sure what's going on there, yet. 😉 Stay tuned.
Would be curious if anyone else can setup a local 9.2.x core test site, checkout the MR branch as a module in that site, then run phpunit locally to try to run the tests directly under D9. Would love to hear about the results.
Comment #24
scott_euser commentedThe tests do run for me within DDEV from your merge request
I do still get these deprecation notices in the results too though:
Comment #25
guilhermevp commentedWell, I think that updating
drupalPostForm()can be solved in a new issue.Comment #26
dwwGreat, thanks!
Initial investigation into the local phpunit seg faults are that my machine is running out of RAM deep inside a very complex
preg_replace_common(). I haven't yet had a chance to dig deeper. But it's encouraging that the tests all pass for @scott_euser locally on D9. I'm prepared to chalk this up to my local environment and not the fault of the porting efforts in here. So back to NR and unassigned.I am curious if the tests in here, or the module code itself, are doing things with preg_replace* that could be optimized to be less resource intensive, but that also seems out of scope for this particular issue.
Completely agreed that #3208369: drupalPostForm() is deprecated, use $this->submitForm() instead. should remain a separate issue. ;) That's only about Drupal 10 compatibility. We've got plenty of time to fix that. Thanks for already opening that one and providing the patch, @guilhermevp!
Comment #27
dwwAlso, I don't think this is a 'feature'. This is more accurately a task. Also, more explicit /accurate title.
Comment #28
dwwI don't think this is a 'feature', it's more accurately a 'task'. Also, more explicit /accurate title.
Comment #29
dwwhttps://www.drupal.org/pift-ci-job/2094540 was complaining about some new code style bugs from the MR (in particular, some unused use statements). I just ran phpcbf from the 9.2.x core site and pushed the results to the MR. Hopefully this next test run will be pretty clean. I don't think we need to completely solve all the CS stuff in here, this is already turning into a fairly big MR.
Comment #30
scott_euser commentedI'm happy to mark this as RTBC - with the patch from the MR I can successfully use the module from configuration to extending it for a complex use case one of our projects has. Note I have not looked line by line at the code itself though.
Thanks very much for all the work on this!
Comment #33
dww#3219216: Offer to co-maintain Form mode manager is fixed and I'm now a co-maintainer. ;)
So I pushed all the commits from the MR into the 8.x-2.x branch. 🎉
I've got a few other things I'd like to land ASAP, then I'll tag a new RC with D9 compatibility. I'll post a link here when the release is out, but calling this fixed for now.
Thanks everyone!
-Derek
Comment #35
dwwhttps://www.drupal.org/project/form_mode_manager/releases/8.x-2.0-rc4 is now out. Enjoy!