After testing it and deinstalling reinstalling et cetera. The Menulink now appears several times. Stil its a bit buggy. Can you help me out here? Thanks!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gdelver@xs4all.nl created an issue. See original summary.

d.popov’s picture

Hi,
I will test and try to reproduce the issue. In the meantime you can just manually delete the menu links (they should be editable and delitable) and then install the module to only have one registration link.

Ivo.Radulovski’s picture

was it possible to reproduce the issue?

d.popov’s picture

Status: Active » Closed (cannot reproduce)

I could not reproduce the issue. Need more info!

sheise’s picture

I was able to reproduce the issue. Every time database updates (drush updb) are run, a new link for "Register an Account" gets added.

sheise’s picture

Status: Closed (cannot reproduce) » Active
Elmar Kleikamp’s picture

I have a one week old, fresh Drupal 8.31 install. I also enabled Forums Module from the core recently and added the Registration Link module. I installed also Zymphonies Theme.
Since I have enabled the Registration Link module, unwanted Links are automatically created from the system.
A simple click on Configuration, and then "Back to site" is enough for an additional menu link "Register an Account" appearing in my main Navigation Menu.
Also multiple menu links are added to the existing one when I look for system status report or undertake similar actions like confinguring user roles e.t.c.
Removing all the unessecary links is not fun at all. Unfortunately I need the "Register an Account" link on the frontpage of my website.
The Registration Link module most definitely has a bug that needs to be solved.
I´m not a programmer but when requested I can give access to my website if anyone has an interest in solving the issue.

KrypticBit’s picture

I can confirm that this issue exists, until it's fixed it makes the module unusable in my opinion. I've also looked at the code and to me it appears obvious why it's doing this. The PHP script needs to be in an if/else statement,
`if menu block = correct values then don't run PHP else Run PHP and add the registration link.`
If I have the time I might look into fixing it, don't count on it though I'm pretty busy right now.

rootwork’s picture

Version: 8.x-1.0 » 8.x-1.x-dev
Priority: Major » Critical

Updating status. Agreed that this makes the module unusable.

boromino’s picture

Status: Active » Needs review
FileSize
4.82 KB
useernamee’s picture

Hey boronimo.
Your patch sadly doesn't work for administrator role since _access_user_register only allows anonymous access (check Drupal\user\Access\RegisterAccessCheck).

Otherwise your #10 patch solves the problem of multiplication of registration link after drush updb.

useernamee’s picture

Hi.
I have written a custom access check for user.register route, which allows administrator to access this route. I have worked on the @boronimo's patch so I have included his patch in mine.

useernamee’s picture

There is a problem with patch #12 - it does not apply.
Here is working patch:

alesbencina’s picture

Hi, @useernamee,
I have tested your patch and it does apply nicely.
It works when admin change configuration who can register (only admin or also anonymous.)

nkoporec’s picture

Status: Needs review » Needs work

Hey @useernamee, tried to test the latest patch but it doesn't apply.
Getting this error

error: patch failed: registration_link.info.yml:1
error: registration_link.info.yml: patch does not apply

I'm using Drupal 8.5 and 8.x-1.x branch.

useernamee’s picture

Status: Needs work » Needs review
FileSize
7.04 KB

I was working on 8.x-1.x-dev version which I got from composer. After cloning this repo from git the patch did not apply to me.

So here is the patch that should apply.

nkoporec’s picture

Status: Needs review » Reviewed & tested by the community

Hi, tested the patch and it applies cleanly also it fixes the issue.

Note: To get the patch to work you must uninstall the module, apply the patch and then reinstall the module.

superbole’s picture

I had this problem on 8.x-1.0 version and patch 16 fixed the issue for me.

I did a manual patch.

I also followed the note in #17, I cannot confirm it is necessary, I can confirm it works.

KrypticBit’s picture

#16 Worked for me. Thanks!

i-trokhanenko’s picture

Status: Reviewed & tested by the community » Needs work

Patch #16 looks good for me, but need to rewrite it.
But given that it would change a bit the module structure, I would suggest to release in a 2.x branch.

i-trokhanenko’s picture

Component: User interface » Code
Assigned: Unassigned » i-trokhanenko
i-trokhanenko’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev
i-trokhanenko’s picture

Status: Needs work » Fixed
i-trokhanenko’s picture

Assigned: i-trokhanenko » Unassigned

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.