Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content element selector doesn't let you select elements, only pages and articles #2046

Closed
sietsevandreven opened this issue Jul 30, 2020 · 10 comments · Fixed by #3457
Closed
Assignees
Labels
Milestone

Comments

@sietsevandreven
Copy link

sietsevandreven commented Jul 30, 2020

Affected version(s)

Contao 4.9.2

Description

The content element selector in backend doesn't let you pick an element. Only lets you pick pages or articles.

@sietsevandreven sietsevandreven changed the title Content element picker Content element selector Jul 30, 2020
@sietsevandreven sietsevandreven changed the title Content element selector Content element selector doesn't let you select elements, only pages and articles Jul 30, 2020
@fritzmg
Copy link
Contributor

fritzmg commented Jul 30, 2020

The latest version is 4.9.4, did you verify it there?

@sietsevandreven
Copy link
Author

The problem is a bit different in 4.9.4. In some cases the content element selector opens a popup backend. I then can browse the backend like normal, but unable to select a content ekement. In other cases the popup shows all elelments in the article I placed the content element selector in. Getting out of that article is no option.

@leofeyer
Copy link
Member

leofeyer commented Aug 6, 2020

How do we reproduce the issue in the online demo?

@sietsevandreven
Copy link
Author

Edit an article, doesn't matter which one... If you add a content element (Inhaltselemente) you are able to link to an element in whatever article... When you click on Change Selection a pop-up opens. In it the content of the article you are working in. If you want to choose an element of an other article you have to open the menu (in previous Contao versions you could just click on the back button and it would automatically open in article/element view only). When the menu opens, click on article and open a different article than you are working in. You then see all element in that article, but you can't select them.

@leofeyer
Copy link
Member

I cannot reproduce this issue. Here is what I have done:

  • Edit the article "Include Elements" in the online demo.
  • Add a new content element and change the type to "Inhaltselement".
  • Click on "Auswahl ändern", which opens the picker.
  • Go to the articles module either via the tab menu or via the back button.
  • Edit the article "Home" and pick a content element.
  • Click on "Anwenden".

The element is selected without a problem.

@leofeyer leofeyer added this to the 4.9 milestone Oct 1, 2020
@stale
Copy link

stale bot commented Nov 30, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 30, 2020
@stale stale bot closed this as completed Dec 7, 2020
@mandrael
Copy link

mandrael commented Jul 14, 2021

Same issue within "Events". There the workaround above is okay for admins. But the issue renders the picker useless for users. This can be reproduced in the online demo:

  1. Go to https://demo.contao.org/contao?do=user
  2. Enter James Wilson's user area
  3. go to events and enter content area of any event, e.g. the first (Contao North-Day)
  4. Create new element, "inhaltselement", "bezogenes inhaltselement": "auswahl ändern"
Error message:
Forbidden
Was ist das Problem?
Invalid content element ID 6.

The event has ID 6
Include Elemente / Article works, you can select an article. And the rest works, too.

PS: same issue in "News"/"Nachrichten"

@fritzmg fritzmg reopened this Jul 14, 2021
@stale stale bot removed the stale label Jul 14, 2021
@fritzmg fritzmg added stale and removed unconfirmed labels Jul 14, 2021
@stale stale bot removed the stale label Jul 14, 2021
@leofeyer
Copy link
Member

I have debugged the issue and here is the problem: If do=calendar, Contao will use tl_content_calendar::checkPermission() instead of tl_content::checkPermission(). However, the picker URL is contao/picker?context=dc.tl_content&extras%5BfieldType%5D=radio&extras%5Bsource%5D=tl_content.344&value=, so the do=calendar part gets lost and Contao falls back to using tl_content::checkPermission().

@leofeyer leofeyer added the up for discussion Issues and PRs which will be discussed in our monthly Mumble calls. label Aug 23, 2021
@leofeyer
Copy link
Member

#2201 is in fact the same problem.

@leofeyer leofeyer removed the up for discussion Issues and PRs which will be discussed in our monthly Mumble calls. label Aug 26, 2021
@ausi ausi linked a pull request Sep 12, 2021 that will close this issue
@ausi
Copy link
Member

ausi commented Sep 12, 2021

#2201 is in fact the same problem.

The CURRENT_ID problem is a different one here, should be fixed by #3457

m-vo pushed a commit to m-vo/contao that referenced this issue Sep 27, 2021
Description
-----------

| Q                | A
| -----------------| ---
| Fixed issues     | Fixes contao#2046

A picker that picks elements from a child table like the one used in the include content element currently creates links like `?do=article&table=tl_content` which show an empty page because the pid (`id=`) is missing.

If there is a `CURRENT_ID` in the session, an arbitrary page might show up instead of an empty page, or it causes a permission error as in contao#2046.

This pull request fixes this by only adding the `table=` parameter if there is a valid pid.

Commits
-------

651d8df Fix picker for child tables without pid
f333be6 Move the default declaration above the if condition
5348926 Handle the case that $ptable is false

Co-authored-by: Martin Auswöger <martin@auswoeger.com>
bezin pushed a commit to bezin/contao that referenced this issue Nov 26, 2021
Description
-----------

| Q                | A
| -----------------| ---
| Fixed issues     | Fixes contao#2046

A picker that picks elements from a child table like the one used in the include content element currently creates links like `?do=article&table=tl_content` which show an empty page because the pid (`id=`) is missing.

If there is a `CURRENT_ID` in the session, an arbitrary page might show up instead of an empty page, or it causes a permission error as in contao#2046.

This pull request fixes this by only adding the `table=` parameter if there is a valid pid.

Commits
-------

651d8df Fix picker for child tables without pid
f333be6 Move the default declaration above the if condition
5348926 Handle the case that $ptable is false

Co-authored-by: Martin Auswöger <martin@auswoeger.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants