Input id="comment" not-unique on black/whitelist page

Please follow the below template, it will help us to help you!

Please ensure that you are running the latest version of the beta code.
Run pihole -up to update to the latest, then verify that the problem still exists before reporting it.

Problem with Beta 5.0:
When I open the new whitelist, blacklist or group management adlists page, the browser's console says <input id="comment class="form-control" is not-unique.

Debug Token:
-

Is this causing the page to not render properly?

No, the pages are working as expected so far.

But there must not exist multiple elements with the same id value in the document.
They should be enumerated or set as class values instead.
In contrast to ids, classes may occur several times in the document.

The web interface is at GitHub - pi-hole/AdminLTE at release/v5.0 if you'd like to address the issue.

Thanks for reporting this. I have never learned to code Javascript and the uniqueness of ids is actually new to me. Interestingly enough, Firefox has never shown this kind of warning to me.

Could you check if I found them all and maybe if I didn't break anything as well?

pihole checkout web fix/class_instead_id

I've checked it out, but it breaks site function for me because changed values gets reset after a page refresh.

I had a look into the code and would prefer use ids with appended Database ID to the name to get it unique, e.g. comment_7.

I could provide a pull request on GitHub for that if you like.

1 Like

Yeah, go ahead! I can use any support in the beta code. I'm currently looking at a more subtle problem with FTL and internal name resolution and it's good if I can invest all my spare time into this problem.

I don't know if this has something to do with the topic actually, but i just found:

Version status (pihole -v):

Pi-hole version is v4.3.2-419-gee7090b (Latest: v4.3.2)
AdminLTE version is v4.3.2-424-ge169bec (Latest: v4.3.3)
FTL version is vDev-ff840d0 (Latest: v4.3.1)

(updated this morning and received only one for AdminLTE)

The issue: The WebIF seems working normally, but a click on Domains in Group Management produces a line with a combined error message in lightpd's error log:

(mod_fastcgi.c.421) FastCGI-stderr: PHP message: PHP Notice: Undefined index: type in /var/www/html/admin/scripts/pi-hole/php/header.php on line 433PHP message: PHP Notice: Undefined index: type in /var/www/html/admin/scripts/pi-hole/php/header.php on line 437

Thanks for reporting this, it seems that this is another issue.

In this two lines in header.php the url's ?type= parameter is checked whether it is "white" or "black".
This parameter is used for the whitelist or blacklist site, but not set (and not used) on the Group Management > Domains site.

To fix this, type needs first be checked whether it is set (with isset($_GET['type'])
or a default value must be specified (with $_GET['type'] ?? "") in that lines.

1 Like

Ah, yes. I forgot about this, thanks for checking. Could you just add this with your proposed PR? It's hardly a change that requires a dedicate PR if you're anyway going to open another one.

sure.

Thank you! Merged.