Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Sub-issue for meta issue #1880976: [meta] Port examples (including submodules) to D9.4+
Problem/Motivation
D8 all the things!
Proposed resolution
Start with D7 version and figure out how to port ;)
Testing Instructions
- Enable Bartik or other theme (except seven theme) as administration theme.
- Enable the module.
- Try adding new article or basic page
- You should be able to see a new vertical tab with a checkbox.
- Tick the checkbox and try to update the default summary.
The summary should update!!
Comment | File | Size | Author |
---|---|---|---|
#44 | 2102695-44.patch | 9.4 KB | navneet0693 |
#44 | interdiff-42-44.txt | 816 bytes | navneet0693 |
#42 | 2102695-42.patch | 9.41 KB | navneet0693 |
| |||
#42 | interdiff-40-42.txt | 3.68 KB | navneet0693 |
#40 | interdiff.txt | 5.51 KB | Mile23 |
Issue fork examples-2102695
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #1
juanjesustrigo CreditAttribution: juanjesustrigo commentedI'll work on this
Comment #2
Mile23Great, thanks!
Be sure and check out the examples module checklist: #2209627: [meta] Module Checklist for Examples
Comment #3
marvil07 CreditAttribution: marvil07 commentedUnassigning for now, please add a patch if there is some initial work done.
Comment #4
Palashvijay4O CreditAttribution: Palashvijay4O commentedWill be working on the issue .
Comment #5
Palashvijay4O CreditAttribution: Palashvijay4O commentedHere's the first patch. I was having a problem in linking the node/add page to content using \Drupal::l() . Please check if i am doing something wrong so that I can go ahead .
Thanks!
Comment #6
Palashvijay4O CreditAttribution: Palashvijay4O commentedSorry for the wrong patch.
Comment #7
Palashvijay4O CreditAttribution: Palashvijay4O commentedThanks Mile23 it worked for me after changing node/add to node/add_page .
Will be working on this ahead.
Comment #10
Kristen PolPalashvijay4O - Thanks for working on this issue. I haven't ported a module from D7 => D8 so someone else will need to review your work. I can help with testing though once you think you are done with the code.
Comment #11
Palashvijay4O CreditAttribution: Palashvijay4O commentedI have ported whole module but only part that is not working is the summary that needs to be updated when checkbox is checked is not showing . Please someone help me over this.
The link to the sandbox port of this module is https://www.drupal.org/sandbox/palashvijay4/2428101
Thanks !!
Comment #12
Palashvijay4O CreditAttribution: Palashvijay4O commentedThere is some problem in js file help me over this I am not sure exactly what is wrong but what I think is the change in css of the node/edit page of drupal 8 as compared to drupal 7 .
Comment #13
mrjmd CreditAttribution: mrjmd commented@Palashvijay4O, I've fixed up and submitted a patch over on your sandbox. See #2434151: JS fixes and switch to details field. I'll attach the patch here as well but it applies against the sandbox.
Comment #15
mrjmd CreditAttribution: mrjmd commentedSwitching back to needs review, that fail is expected since patch applies elsewhere. Here are a couple of screenshots. I should have mentioned, I had to switch the admin theme to see this properly, because the Seven theme overrides how vertical tabs work. That is probably an issue that needs further discussion.
Comment #16
Palashvijay4O CreditAttribution: Palashvijay4O commentedI think https://www.drupal.org/sandbox/palashvijay4/2428101 is ready to be commited.
Comment #17
mrjmd CreditAttribution: mrjmd commentedPatch attached against current 8.x-1.x branch.
Comment #18
Kristen PolI see the EXAMPLE VERTICAL TAB in the node edit form… I'm not sure what the "Use this setting instead" is supposed to do though… I haven't tried the D7 version… when I type text into "Use this setting instead" I don't see anything obviously change.
Please add test instructions to the issue summary. Thanks!
Comment #19
Kristen PolPalashvijay4O said to try with Bartik as admin theme and I did that. When I click the checkbox and change the "Use this setting instead" text, I do see the description change for the tab. But, when I save the form and go back, the checkbox is unchecked and the text I added before is wiped out. Is this intentional?
Comment #20
Palashvijay4O CreditAttribution: Palashvijay4O commentedThe same thing happens with D7 version of this module so I guess pretty much that is intentional. And also I think the lesson is about adding vertical tabs to the node edit/add form.
Comment #21
Palashvijay4O CreditAttribution: Palashvijay4O commentedComment #22
Kristen PolFor a proper review, someone with more D8 experience needs to take a look. I found a couple minor commenting things:
Nitpick: Use periods in comments.
Should there be a comment?
Comment #23
Palashvijay4O CreditAttribution: Palashvijay4O commentedMade changes as suggested. Please review.
Comment #25
Palashvijay4O CreditAttribution: Palashvijay4O commentedSorry submitted a wrong patch.
Comment #26
Kristen PolThis is working for me on simplytest.me and I see the comments were updated. I'll mark this RTBC but someone with experience writing D8 modules should really take a look.
Comment #27
Mile23First, really sorry about not getting to this sooner.
Second, thanks for sticking with it.
And third, here are a few things:
This is incorrect because the settings tabs are beside the content now, instead of below.
This test should also look for the menu links from the front page.
We also need tests for:
This file should have # comments telling you why you're including these libraries.
We have routing.yml but not links.menu.yml, so the link never appears on the front page.
Comment #28
Mile23As we discussed in IRC there is an issue with the status update JS. Let's be sure and address that after the other items above.
Comment #29
tim.plunkettNot a real issue tag.
Comment #30
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commented@Mile23
Are we saving the settings ? I have gone through the code, i couldn't see it. Please correct me if I am wrong. Only JS part is not working with "Seven" theme. Works good with Bartik and others.
Comment #31
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commented@Mile23 Completed tasks mentioned in #27. The summary in "Seven" as Administrator theme, is not supported I guess. Please, correct me, if I am wrong.
Comment #33
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedAdded some more test and corrected placeholder.
Comment #34
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer commented#collapsible
doesn't exist for details.#collapsed
is now#open
Comment #35
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer commentedThe form here needs a lot of work.
While working on #1148950: Applying #states to a vertical tab does not update the vertical tabs menu I created a test module for the issue, feel free to have a look to see how to setup a form with vertical tabs on Drupal 8. Just enable it and go to
/vertical_tabs_states_test/form/default
.Comment #36
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedThanks @Manuel Garcia, I will work on this further more after look into your code.
Comment #37
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedStarting working on this again!
Comment #38
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedRe-rolled it. But as said, this will only work with themes other than "Seven" as administration theme.
Comment #39
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedComment #40
Mile23I improved the inline comments some, fixed CS errors, made it explicitly require node module.
Still needs:
Comment #41
Mile23Comment #42
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedConverted test to BTB.
Comment #43
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer commentedThanks @navneet0693!
Let's use
$web_assert->elementExists('css', '#edit-vertical-tabs-example');
instead.Comment #44
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commented@Manuel Garcia,
Done :-)
Comment #45
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer commentedThanks for that @navneet0693 :)
#34 still needs to be addressed. Also see #35
Comment #46
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commented@Manuel Garcia,
Thank you, I will work upon it :-)
Comment #47
Mile23