Route without wildcard still considers all sub-routes

Created on 26 November 2024, 22 days ago

Problem/Motivation

(I just installed it on my site that is now on Drupal 10.3.9.)
When setting up the "Add nofollow noindex routes" in the configuration, even if I don't use wildcard, the metatag for "nofollow, noindex" is added to all sub-routes (sub-pages) to that page.
For example, if I elect to add "nofollow, noindex" to "/mypage" only (relative path), it will also add "nofollow, noindex" to any sub-page of "/mypage", for example "/mypage/mysubpage".

Steps to reproduce

Install module, set it for any page (without using wildcard) and test it in any "sub-page" following the logic above.

Proposed resolution

Change how the conditions for $no_index are set in nofollow_noindex.module
(I've made a small change to my local code as a patch and it works in my specific case. But I realize more extensive changes would be needed to make the solution fit all scenarios - assuming the behaviour I've noted above is not what people actually want).

🐛 Bug report
Status

Active

Version

2.1

Component

Code

Created by

🇨🇦Canada aarantes

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024