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

Add backend link to Contao manager #26

Closed
dmolineus opened this issue Aug 23, 2018 · 9 comments
Closed

Add backend link to Contao manager #26

dmolineus opened this issue Aug 23, 2018 · 9 comments

Comments

@dmolineus
Copy link
Contributor

It's just a small thing, but for some users it would be a nice addition if the Contao Manager is linked in the Contao backend. The idea is to add a separate link in the system section of the backend navigation which would open the contao manager in a new window. If you like the idea, I'll provide an PR.

Idea how to implement it:

  • Provide a config parameter which points to the Contao Manager entrypoint.
  • If config parameter is set, the backend link is generated automatically.
  • Maybe there could also be an autolookup which scans for typical names like contao-manager.phar.php oder contao-manager.php and would set the parameter automatically.

I guess it should be part of the manager-bundle instead of the core-bundle, am I right?

@ausi ausi assigned ausi and unassigned ausi Aug 23, 2018
@leofeyer
Copy link
Member

I'm not sure about this, as the manager is not part of the backend. @aschempp /cc

@aschempp
Copy link
Member

aschempp commented Sep 3, 2018

I very much like the idea, I think it was actually proposed before. The Manager is not part of the backend, but it is an integral part of the system. Here's how it should work in my opinion:

  1. A menu option in the system setting, only visible to admins (does not need to be configurable in my opinion).
  2. A bundle config to specify the path
  3. If no path is given, use the bundle extension to check for the default (web/contao-manager.phar.php) and if so, write that to config
  4. If config is not empty, show the link in the backend

@dmolineus would you create a PR for this?

@dmolineus
Copy link
Contributor Author

Yes, I'll create a PR for it. Your proposal how it should work is the same idea I do have in mind.

I guess it should be part of the manager-bundle instead of the core-bundle, am I right?

Wdyt?

@leofeyer
Copy link
Member

leofeyer commented Sep 3, 2018

Definitely. If you add the core bundle to an existing Symfony installation, the link does not make sense.

@dmolineus
Copy link
Contributor Author

Closed in favour of #46.

leofeyer pushed a commit that referenced this issue Nov 26, 2018
Description
-----------

This is the follow up PR for #26 and automatically adds a link to the Contao manager in the backend navigation for admin users.

Marked as WIP as unit tests yet missing. 

Some questions which might be discussed in the meantime:
 - Should the label "Contao Manager" be translated or is it treated as a trade name?
 - Atm the link is not added if the system group is not available. Should it be created otherwise?
 - Link is added with a target attribute. Don't mind to remove it again.
 - Any idea how to test the configuration (it checks if the configured file exists)?

Commits
-------

1dc49f1 Allow target attribute.
e8e8bd0 Add link to contao manager in the backend navigation.
b61008b Fix checking of attribute.
5d27444 Provide unit tests.
aafb0f1 Remove built in support for contao-manager.php b/c @aschempp insisted to remove it.
deca785 Use contao.web_dir instead of hardcoded web dir.
3f80900 Use contao.web_dir instead of hardcoded web dir.
8142a2a Fix the coding style
8f8a27e Refactor the back end nenu listener test
35b2908 Refactor the Contao Manager extension test
leofeyer pushed a commit to contao/manager-bundle that referenced this issue Nov 26, 2018
Description
-----------

This is the follow up PR for contao/contao#26 and automatically adds a link to the Contao manager in the backend navigation for admin users.

Marked as WIP as unit tests yet missing. 

Some questions which might be discussed in the meantime:
 - Should the label "Contao Manager" be translated or is it treated as a trade name?
 - Atm the link is not added if the system group is not available. Should it be created otherwise?
 - Link is added with a target attribute. Don't mind to remove it again.
 - Any idea how to test the configuration (it checks if the configured file exists)?

Commits
-------

1dc49f16 Allow target attribute.
e8e8bd0a Add link to contao manager in the backend navigation.
b61008bb Fix checking of attribute.
5d274441 Provide unit tests.
aafb0f12 Remove built in support for contao-manager.php b/c @aschempp insisted to remove it.
deca7859 Use contao.web_dir instead of hardcoded web dir.
3f80900b Use contao.web_dir instead of hardcoded web dir.
8142a2ac Fix the coding style
8f8a27e3 Refactor the back end nenu listener test
35b29085 Refactor the Contao Manager extension test
leofeyer pushed a commit to contao/core-bundle that referenced this issue Nov 26, 2018
Description
-----------

This is the follow up PR for contao/contao#26 and automatically adds a link to the Contao manager in the backend navigation for admin users.

Marked as WIP as unit tests yet missing. 

Some questions which might be discussed in the meantime:
 - Should the label "Contao Manager" be translated or is it treated as a trade name?
 - Atm the link is not added if the system group is not available. Should it be created otherwise?
 - Link is added with a target attribute. Don't mind to remove it again.
 - Any idea how to test the configuration (it checks if the configured file exists)?

Commits
-------

1dc49f16 Allow target attribute.
e8e8bd0a Add link to contao manager in the backend navigation.
b61008bb Fix checking of attribute.
5d274441 Provide unit tests.
aafb0f12 Remove built in support for contao-manager.php b/c @aschempp insisted to remove it.
deca7859 Use contao.web_dir instead of hardcoded web dir.
3f80900b Use contao.web_dir instead of hardcoded web dir.
8142a2ac Fix the coding style
8f8a27e3 Refactor the back end nenu listener test
35b29085 Refactor the Contao Manager extension test
@mlwebworker
Copy link

Im Forum wurde heute über einen Link zum Manager im Backend diskutiert. Einige haben den Link in der 4.7 gesichtet. Wahrscheinlich aber in der dev-Variante. In meinen stable-Versionen 4.7.1 ist keiner. Sollte der dasein oder kommt er doch erst in der 4.8. Hier noch der Link zum Forum https://community.contao.org/de/showthread.php?67084-Hinweise-zum-Contao-Manager&p=498583&viewfull=1#post498583

@netzarbeiter
Copy link
Member

Bei mir ist der Link in einer 4.7.1 vorhanden.

manager

@mlwebworker
Copy link

Dann werde ich heute mal eine Neuinstallation testen. Die Installationen sind alle Updates einer 4.4 bzw. 4.6

@mlwebworker
Copy link

Das Problem hat sich erledigt. Es tritt nur deshalb auf, weil ich meinen Contao Manager immer mit cm.phar.php benenne https://community.contao.org/de/showthread.php?67084-Hinweise-zum-Contao-Manager&p=498677&viewfull=1#post498677

leofeyer pushed a commit that referenced this issue Aug 4, 2020
Description
-----------

With @Toflar we have discovered by accident that if a URL is double-encoded (for some reason, doesn't matter) the Contao's `RouteProvider` will eventually throw an error trying to query a database.

```
URL original: drachenlochmuseum-v%25c3%25a4ttis.html
URL decoded: drachenlochmuseum-v%c3%a4ttis.html
URL decoded 2nd time: drachenlochmuseum-vättis.html
```

The decoded URL is used in the database query and that fails because the database driver would like to replace wildcards `%c` with parameters that were not provided.

Stack trace:

```
Exception: Too few arguments to build the query string
#27 vendor/contao/core-bundle/src/Resources/contao/library/Contao/Database/Statement.php(304): replaceWildcards
#26 vendor/contao/core-bundle/src/Resources/contao/library/Contao/Database/Statement.php(249): execute
#25 vendor/contao/core-bundle/src/Resources/contao/library/Contao/Model.php(1102): find
#24 vendor/contao/core-bundle/src/Resources/contao/library/Contao/Model.php(973): findBy
#23 vendor/contao/core-bundle/src/Framework/Adapter.php(38): __call
#22 vendor/contao/core-bundle/src/Routing/RouteProvider.php(493): findPages
#21 vendor/contao/core-bundle/src/Routing/RouteProvider.php(88): getRouteCollectionForRequest
#20 vendor/contao/core-bundle/src/Routing/LegacyRouteProvider.php(43): getRouteCollectionForRequest
#19 vendor/symfony-cmf/routing/src/NestedMatcher/NestedMatcher.php(141): matchRequest
#18 vendor/contao/core-bundle/src/Routing/Matcher/LegacyMatcher.php(69): matchRequest
#17 vendor/symfony-cmf/routing/src/DynamicRouter.php(271): matchRequest
#16 vendor/symfony-cmf/routing/src/ChainRouter.php(188): doMatch
#15 vendor/symfony-cmf/routing/src/ChainRouter.php(158): matchRequest
#14 vendor/symfony/http-kernel/EventListener/RouterListener.php(115): onKernelRequest
#13 vendor/symfony/event-dispatcher/EventDispatcher.php(212): doDispatch
#12 vendor/symfony/event-dispatcher/EventDispatcher.php(44): dispatch
#11 vendor/symfony/http-kernel/HttpKernel.php(126): handleRaw
#10 vendor/symfony/http-kernel/HttpKernel.php(67): handle
#9 vendor/symfony/http-kernel/Kernel.php(198): handle
#8 vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php(85): handle
#7 vendor/symfony/http-kernel/HttpCache/HttpCache.php(448): forward
#6 vendor/symfony/framework-bundle/HttpCache/HttpCache.php(57): forward
#5 vendor/symfony/http-kernel/HttpCache/HttpCache.php(420): fetch
#4 vendor/contao/manager-bundle/src/HttpKernel/ContaoCache.php(46): fetch
#3 vendor/symfony/http-kernel/HttpCache/HttpCache.php(317): lookup
#2 vendor/symfony/http-kernel/HttpCache/HttpCache.php(192): handle
#1 vendor/friendsofsymfony/http-cache/src/SymfonyCache/EventDispatchingHttpCache.php(98): handle
#0 web/app.php(58): null
```

Commits
-------

8ae2582 Fix a potential error if the URL has percentage in it
8caaf25 Fix unit tests
509f762 Correctly encode the page aliases
@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
None yet
Projects
None yet
Development

No branches or pull requests

6 participants