Bug #82969

Javascript Error in Backend

Added by Markus Günther about 2 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend JavaScript
Target version:
-
Start date:
2017-11-10
Due date:
% Done:

100%

TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When you create an non admin backend user and don`t add access to modules. You get JS errors in the backend.

I know that it is not useful to have a user without that permissions. But the backend allow users to do this and then
it should not happen that you get such errors in your console.

At the moment it seems that all versions are effected.

Bildschirmfoto 2017-11-15 um 06.04.06.png View (734 KB) Markus Günther, 2017-11-15 06:05

Bildschirmfoto 2017-11-15 um 06.13.56.png View (495 KB) Markus Günther, 2017-11-15 06:14

Bildschirmfoto 2017-11-15 um 06.15.46.png View (336 KB) Markus Günther, 2017-11-15 06:16


Related issues

Related to TYPO3 Core - Bug #84335: LiveSearch: Cannot read property 'options' on undefined Closed 2018-03-16

Associated revisions

Revision 7c7e4edb (diff)
Added by Markus Günther almost 2 years ago

[BUGFIX] Prevent javascript error in backend

Adding a condition to check if a backend user has permissions on the
search to prevent a JS error while initializing the autocomplete module.

Fixes: #82969
Releases: master, 8.7, 7.6
Change-Id: If2827902443ff7411d9b2c1050213be3e0d78fb6
Reviewed-on: https://review.typo3.org/54694
Tested-by: TYPO3com <>
Reviewed-by: Andreas Fernandez <>
Tested-by: Andreas Fernandez <>
Reviewed-by: Alexander Opitz <>
Reviewed-by: Wouter Wolters <>
Tested-by: Wouter Wolters <>

Revision f3a43aea (diff)
Added by Markus Günther almost 2 years ago

[BUGFIX] Prevent javascript error in backend

Adding a condition to check if a backend user has permissions on the
search to prevent a JS error while initializing the autocomplete module.

Fixes: #82969
Releases: master, 8.7, 7.6
Change-Id: If2827902443ff7411d9b2c1050213be3e0d78fb6
Reviewed-on: https://review.typo3.org/54710
Tested-by: TYPO3com <>
Reviewed-by: Wouter Wolters <>
Tested-by: Wouter Wolters <>

Revision 26f68b8a (diff)
Added by Markus Günther almost 2 years ago

[BUGFIX] Prevent javascript error in backend

Adding a condition to check if a backend user has permissions on the
search to prevent a JS error while initializing the autocomplete module.
Also check if a module is available to start with.

Fixes: #82969
Releases: master, 8.7, 7.6
Change-Id: If2827902443ff7411d9b2c1050213be3e0d78fb6
Reviewed-on: https://review.typo3.org/54714
Reviewed-by: Markus Günther <>
Tested-by: Markus Günther <>
Tested-by: TYPO3com <>
Reviewed-by: Stefan Neufeind <>
Reviewed-by: Henning Liebe <>
Reviewed-by: Alexander Opitz <>
Tested-by: Alexander Opitz <>

Revision 7e1f77ef (diff)
Added by Andreas Fernandez over 1 year ago

[BUGFIX] Call autocomplete only if field is available

Resolves: #84335
Related: #82592
Related: #82969
Releases: master
Change-Id: I6afa442fdfb86e2ffeff0b3c39c12ed2c7e8df6c
Reviewed-on: https://review.typo3.org/56211
Tested-by: TYPO3com <>
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>
Reviewed-by: Tymoteusz Motylewski <>
Tested-by: Tymoteusz Motylewski <>

History

#1 Updated by Frank Naegler about 2 years ago

  • Category set to Backend JavaScript
  • Status changed from New to Needs Feedback

Hey Markus,
can you please add more info like the conrete error message or a console output?

#2 Updated by Markus Günther about 2 years ago

Hi Frank,

it is a bit different on each TYPO3 version.

Steps to reproduce the failure:

  1. Create a new backend user
  2. Enter only a username and password because these are the only mandatory fields
  3. save and close
  4. Switch to the backend user and then you have the errors on all backends

In the current master you get an exception for the module, which is right. But also the JS error that the autocomplete has no options.
I would expect to have just the exception ;)

In TYPO3 version 7.6 you get JS errors because the backend is guessing that you have module available, but that is not the case and because
the fields are not mandatory this can happen to regular backend users.

I understand the problem is that you can get the access rights from a group or a single user.
But excerpt solving the JS issues it would be nice to prevent that you are able to create a user that has no module permissions.

#3 Updated by Markus Günther about 2 years ago

Attached screenshot of TYPO3 version 7 LTS

#4 Updated by Markus Günther about 2 years ago

Attached screenshot version 8.

For my local version 7.x instance I already adjusted the JS so that you don't get the errors anymore.
But my last patch is far in the past and I first need to go thru the contribution tutorial.

For patching it.

And I bet it did not change, that I first need to tackle master, then backport to version 8 and then 7. Although version 7 is not really a backport.

#5 Updated by Markus Günther almost 2 years ago

It turns out that after solving an autocomplete issue a new issue lead to another JS error.

In the issue https://forge.typo3.org/issues/83041 I describe that the Admin tools are visible to editors without permissions. And then we have module data in the menu but should not have
any module data. And then the request to the module fails with a code 500.

So this issue ends in another JS error for TYPO3 version 9.

#6 Updated by Gerrit Code Review almost 2 years ago

  • Status changed from Needs Feedback to Under Review

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54692

#7 Updated by Gerrit Code Review almost 2 years ago

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54694

#8 Updated by Gerrit Code Review almost 2 years ago

Patch set 2 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54692

#9 Updated by Gerrit Code Review almost 2 years ago

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54696

#10 Updated by Gerrit Code Review almost 2 years ago

Patch set 3 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54692

#11 Updated by Gerrit Code Review almost 2 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54694

#12 Updated by Gerrit Code Review almost 2 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54694

#13 Updated by Gerrit Code Review almost 2 years ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54710

#14 Updated by Markus Günther almost 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#15 Updated by Gerrit Code Review almost 2 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54714

#16 Updated by Gerrit Code Review almost 2 years ago

Patch set 2 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54714

#17 Updated by Gerrit Code Review almost 2 years ago

Patch set 3 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54714

#18 Updated by Gerrit Code Review almost 2 years ago

Patch set 4 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54714

#19 Updated by Markus Günther almost 2 years ago

  • Status changed from Under Review to Resolved

#20 Updated by Andreas Fernandez over 1 year ago

  • Related to Bug #84335: LiveSearch: Cannot read property 'options' on undefined added

#21 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF