Problem/Motivation

Contact module adds a link to the site-wide contact form in the footer menu
It has no right to do so, and means you cannot disable it later without killing the footer menu.
It belongs in the standard profile (product feature, not framework feature).

Proposed resolution

Move it

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork drupal-2710469

Command icon 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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

larowlan created an issue. See original summary.

dawehner’s picture

<3

dagmar’s picture

Status: Active » Needs review
FileSize
967 bytes

Lets try with this.

naveenvalecha’s picture

do we need an empty hook_post_update_n for clearing cache.
RTBC +1

dagmar’s picture

Well, this is for new installs right?

jibran’s picture

#4 nope we don't need anything here. Should we add a quick test about this?

dagmar’s picture

naveenvalecha’s picture

Status: Needs review » Reviewed & tested by the community

#6 Okay
looks good to be in.

alexpott’s picture

I agree way more stuff should be in standard and not in modules. However given we're changing default behaviour it is perfectly possible that an install profile is relying on this behaviour. So at the very least we need a change record and a discussion of why this should be allowed in minor release.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs change record
dagmar’s picture

Status: Needs work » Needs review
Issue tags: -Needs change record

Change record and explanation here: https://www.drupal.org/node/2714035

dagmar’s picture

Status: Needs review » Reviewed & tested by the community

Moving back to RTBC per #6 and #9 (#9 requested for a change record that was provided on #11).

catch’s picture

Assigned: Unassigned » alexpott

Presence or not of specific config entities shouldn't be considered part of the public API, so I think the change record is plenty here, but moving back to @alexpott

alexpott’s picture

I agree with the move but the issue summary says

It has no right to do so, and means you cannot disable it later without killing the footer menu.

If I add a link to the footer and uninstall contact no menus are killed but the contact link is removed. If there is no other link then yes the menu disappears - but that is becuase it is empty - you can still add new links to it.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 36a23b3 and pushed to 8.2.x. Thanks!

  • alexpott committed 36a23b3 on 8.2.x
    Issue #2710469 by dagmar: Move contact module footer link to standard...
Les Lim’s picture

Priority: Normal » Critical
Status: Fixed » Needs work

I've got a fatal after pulling 8.2.x today: Symfony\Component\Routing\Exception\RouteNotFoundException: Route "contact.site_page" does not exist.

It looks like Standard profile now has a de-facto dependency on Contact module. I had uninstalled it prior to pulling HEAD, but it also breaks if you uninstall Contact on a clean installation of Standard.

Les Lim’s picture

Verified this on a clean simplytest.me with 8.2.x, standard profile, uninstalling Contact first thing after.

joelpittet’s picture

Title: Move contact module footer link to standard install profile » [Regression] Move contact module footer link to standard install profile
Issue tags: +Needs tests

Can confirm with @Les Lim that this does break core when the contact module is uninstalled.

Needs revert first and then some work and maybe some more tests.

joelpittet’s picture

Title: [Regression] Move contact module footer link to standard install profile » [HEAD BROKEN] Move contact module footer link to standard install profile

better title hack?

  • Cottser committed f6e542c on 8.2.x
    Revert "Issue #2710469 by dagmar: Move contact module footer link to...
star-szr’s picture

Title: [HEAD BROKEN] Move contact module footer link to standard install profile » Move contact module footer link to standard install profile
Assigned: alexpott » Unassigned

Since this caused a regression and most of the other committers are not available right now I reverted this. This wasn't a broken head I don't think but was a regression. Could use some tests but is already tagged with that :)

alexpott’s picture

Priority: Critical » Normal

+1 for the revert. Install profile dependencies that aren't really dependencies are really fun!

larowlan’s picture

Symfony\Component\Routing\Exception\RouteNotFoundException: Route "contact.site_page" does not exist.
FWIW you can replicate this error in HEAD, again because of the implicit dependency (mentioned in the OP and the original motivation for this issue).

Steps to reproduce:

  1. install standard
  2. edit footer menu and disable contact link
  3. uninstall contact
  4. visit footer menu edit page
  5. same error

I think we should add an explicit dependency from standard to contact.

Les Lim’s picture

I think we should add an explicit dependency from standard to contact.

I'd rather not - there are plenty of sites that don't need a contact form or would prefer to implement a different solution.

  • alexpott committed 36a23b3 on 8.3.x
    Issue #2710469 by dagmar: Move contact module footer link to standard...
  • Cottser committed f6e542c on 8.3.x
    Revert "Issue #2710469 by dagmar: Move contact module footer link to...

  • alexpott committed 36a23b3 on 8.3.x
    Issue #2710469 by dagmar: Move contact module footer link to standard...
  • Cottser committed f6e542c on 8.3.x
    Revert "Issue #2710469 by dagmar: Move contact module footer link to...

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Berdir’s picture

You can't have "explicit" dependencies on modules as an install profile. It already depends on contact, but that doesn't mean that you can't remove it, which you definitely should be able to.

The correct fix is to create those menu links (all of them in that file really) as content menu links, so that users can remove them if they want to.

Berdir’s picture

  • alexpott committed 36a23b3 on 8.4.x
    Issue #2710469 by dagmar: Move contact module footer link to standard...
  • Cottser committed f6e542c on 8.4.x
    Revert "Issue #2710469 by dagmar: Move contact module footer link to...

  • alexpott committed 36a23b3 on 8.4.x
    Issue #2710469 by dagmar: Move contact module footer link to standard...
  • Cottser committed f6e542c on 8.4.x
    Revert "Issue #2710469 by dagmar: Move contact module footer link to...

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

shivam kaushal’s picture

Assigned: Unassigned » shivam kaushal
shivam kaushal’s picture

Assigned: shivam kaushal » Unassigned
Status: Needs work » Needs review
FileSize
979 bytes
Berdir’s picture

Status: Needs review » Needs work

As mentioned above, this needs to be created as a content link, like the shortcuts in standard_install().

paulocs’s picture

Do we still have this problem?
I didn't have any problem to disable the contact footer link in the Footer menu like @larowlan said in comment #24.

Is a problem that the

contact.site_page:
  title: Contact
  route_name: contact.site_page
  menu_name: footer
  enabled: 0

is adding a link to the footer menu in the standard installation?

paulocs’s picture

Issue tags: +Bug Smash Initiative
paulocs’s picture

Status: Needs work » Postponed (maintainer needs more info)

As discussed in Bug Smash Initiative, I did some tests and didn't find any problem to disable the link as issue summary describes.

Please provide steps to reproduce. For a while I set the issue to Postponed.

Berdir’s picture

Status: Postponed (maintainer needs more info) » Needs work

I'm not sure about the not disable part, but there's still

> It belongs in the standard profile (product feature, not framework feature).

Which I agree with. This can be an annoyance for distributions that don't want that or want it somewhere else.

paulocs’s picture

Status: Needs work » Needs review
FileSize
1.28 KB

A patch for it.

Status: Needs review » Needs work

The last submitted patch, 48: 2710469-48.patch, failed testing. View results

Berdir’s picture

Test fails make sense, these tests use standard so they now have an extra menu link that we have to expect.

It looks like contact module does not have test coverage for that footer link though, so nothing failed, unfortunately. Sounds like we should test that in \Drupal\Tests\standard\Functional\StandardTest.

Also, another complication, contact_help() talks about the menu link, which now is only part of the standard install profile. Not sure what to do about that.

mohit_aghera’s picture

Status: Needs work » Needs review
FileSize
4.12 KB
2.84 KB

@Berdir @paulocs
Adding test case in the standard installation profile to check whether link is present or not.

For the contact module help text update:
Does it make sense if we add a description about creating links manually if required?

larowlan’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs tests

Looks good to me

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

Needs a reroll.

alexpott’s picture

Also the change record needs updating. It's currently recommending the solution that caused us to revert.

nishantghetiya’s picture

Assigned: Unassigned » nishantghetiya

I am working on it and provide an updated patch soon.

nishantghetiya’s picture

Status: Needs work » Needs review
sudiptadas19’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

We still need to update the change record.

ilgnerfagundes’s picture

Status: Needs work » Needs review

Hello, I made the change. Someone can verify that I did the correct.

alexpott’s picture

Status: Needs review » Needs work
Issue tags: -Needs reroll +Needs upgrade path

@ilgnerfagundes the Cr should mention that any install profile that wants to place a contact link somewhere will need to do something like

+  // Create contact footer link.
+  $contact_link = MenuLinkContent::create([
+    'id' => 'contact',
+    'title' => t('Contact'),
+    'link' => ['uri' => 'route:contact.site_page'],
+    'menu_name' => 'footer',
+  ]);
+  $contact_link->save();

in it's hook_install() - ie. what standard does.

However this does beg the question of whether we should be making this change like this. Here are some concerns:

  • If you install standard, view the front page -> there's a contact link, apply this patch, rebuild cache, view front page -> it's not there
  • Any other install profile / distribution that's relying on this link will need to make the same change

I think we need to go back to the drawing board and come up with a solution that doesn't regress existing sites and code that might be relying on this. I think we need to add a hook_modules_installed implementation to the contact module. If (the menu_link_content module is being installed or the contact module is being installed and the menu_link_content module is already installed) AND we're running during a Drupal installation then we should create the menu link. We also need to provide an upgrade path for existing sites. Here we have have to determine if the footer menu exists and if menu_link_content is installed and do different things depending on the outcome. Another complexity is that we need to determine what to do with any existing menu link overrides for the contact menu link.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

nishantghetiya’s picture

Assigned: nishantghetiya » Unassigned
Berdir’s picture

Cross-referencing #3219959: Update standard profile so Olivero is the default theme, looks like olivero does not have a footer menu, so this link is then not actually showing up anymore by default.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

andypost’s picture

It needs more work as making the link as content is not enough, if user will uninstall contact module the menu where link is added will fail to edit, see #3324291: Menu link created by modules are not deleted on module uninstall

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.