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

keep manager-bundle synchronized with core-bundle in 4.4 and 4.5 too #10

Closed
fritzmg opened this issue Aug 20, 2018 · 8 comments
Closed
Assignees
Labels
Milestone

Comments

@fritzmg
Copy link
Contributor

fritzmg commented Aug 20, 2018

Currently, the contao/manager-bundle is not kept in sync with the contao/core-bundle in the 4.4 branch. This leads to situations where only the contao/manager-bundle is updated while all the other contao/core-bundles are not. This leads to some confusion - since the Contao Manager will show that Contao 4.4.21 is installed for example (which is actually the version of the contao/manager-bundle package) while the Contao backend will show that Contao 4.4.20 is installed (wich is actually the version of the contao/core-bundle package).

Shouldn't the requirement be changed to

"contao/core-bundle": "self.version"

in the 4.4 (and 4.5) branch too?

@fritzmg
Copy link
Contributor Author

fritzmg commented Aug 20, 2018

Reproduction:

  1. Install Contao 4.4.20 via composer create-project contao/managed-edition <target> 4.4.20.
  2. Download the contao-manager.phar to the web/ folder and rename it to contao-manager.phar.php.
  3. Log into the Contao Manager and click the Update button for Contao Open Source CMS.
  4. Click Apply Changes.

After the composer operation finished, the Contao Manager will show Version 4.4.21 for Contao Open Source CMS, since the contao/manager-bundle got updated to 4.4.21. However, the rest of the Contao bundles remain at 4.4.20, including the contao/core-bundle.

@fritzmg fritzmg changed the title keep manager-bundle synchronized with core-bundle in 4.4 too keep manager-bundle synchronized with core-bundle in 4.4 and 4.5 too Aug 20, 2018
@leofeyer leofeyer added the bug label Aug 20, 2018
@leofeyer
Copy link
Member

Yes, it should. Both contao/core-bundle and contao/installation-bundle need to be set to self.version.

@leofeyer leofeyer modified the milestones: 4.4.22, 4.6.0 Aug 20, 2018
@leofeyer leofeyer self-assigned this Aug 27, 2018
@leofeyer
Copy link
Member

Fixed in c2a864d.

@fritzmg
Copy link
Contributor Author

fritzmg commented Aug 28, 2018

Hm, I am not sure if this was the correct solution. People update their Contao version in the Contao Manager by updating just the manager-bundle. However, no update will take place at all now, because if you run

composer update contao/manager-bundle

it will not update any of the bundles at all, since they are all locked in place. Example in a Contao 4.4.21 installation:

$ composer update contao/manager-bundle
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
$ composer why-not contao/core-bundle:4.4.22
contao/calendar-bundle      4.4.21  requires  contao/core-bundle (self.version)
contao/comments-bundle      4.4.21  requires  contao/core-bundle (self.version)
contao/faq-bundle           4.4.21  requires  contao/core-bundle (self.version)
contao/installation-bundle  4.4.21  requires  contao/core-bundle (self.version)
contao/listing-bundle       4.4.21  requires  contao/core-bundle (self.version)
contao/news-bundle          4.4.21  requires  contao/core-bundle (self.version)
contao/newsletter-bundle    4.4.21  requires  contao/core-bundle (self.version)

Even if specifically want to update all Contao bundles, it will not update any bundle:

$ composer update contao/calendar-bundle contao/comments-bundle contao/faq-bundle contao/installation-bundle contao/listing-bundle contao/news-bundle contao/newsletter-bundle
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update

The only way to update a Contao installation now is to run the following command:

$ composer update contao/*
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 9 updates, 0 removals
  - Updating contao/core-bundle (4.4.21 => 4.4.22): Downloading (100%)
  - Updating contao/calendar-bundle (4.4.21 => 4.4.22): Downloading (100%)
  - Updating contao/comments-bundle (4.4.21 => 4.4.22): Downloading (100%)
  - Updating contao/faq-bundle (4.4.21 => 4.4.22): Downloading (100%)
  - Updating contao/listing-bundle (4.4.21 => 4.4.22): Downloading (100%)
  - Updating contao/installation-bundle (4.4.21 => 4.4.22): Downloading (100%)
  - Updating contao/manager-bundle (4.4.21 => 4.4.22): Downloading (100%)
  - Updating contao/news-bundle (4.4.21 => 4.4.22): Downloading (100%)
  - Updating contao/newsletter-bundle (4.4.21 => 4.4.22): Downloading (100%)

Or a full package update with composer update of course.

@aschempp may be the Contao Manager needs to be changed, so that whenever the user requests an update of a Contao bundle, it automatically executes

composer update contao/*

What do you think?

@fritzmg
Copy link
Contributor Author

fritzmg commented Aug 28, 2018

Forgot the core-bundle and manager-bundle actually... so this works as well:

$ composer update contao/calendar-bundle contao/comments-bundle contao/faq-bundle contao/installation-bundle contao/listing-bundle contao/news-bundle contao/newsletter-bundle contao/manager-bundle contao/core-bundle --dry-run
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 9 updates, 0 removals
  - Updating contao/core-bundle (4.4.21) to contao/core-bundle (4.4.22)
  - Updating contao/calendar-bundle (4.4.21) to contao/calendar-bundle (4.4.22)
  - Updating contao/comments-bundle (4.4.21) to contao/comments-bundle (4.4.22)
  - Updating contao/faq-bundle (4.4.21) to contao/faq-bundle (4.4.22)
  - Updating contao/listing-bundle (4.4.21) to contao/listing-bundle (4.4.22)
  - Updating contao/installation-bundle (4.4.21) to contao/installation-bundle (4.4.22)
  - Updating contao/manager-bundle (4.4.21) to contao/manager-bundle (4.4.22)
  - Updating contao/news-bundle (4.4.21) to contao/news-bundle (4.4.22)
  - Updating contao/newsletter-bundle (4.4.21) to contao/newsletter-bundle (4.4.22)

@ausi
Copy link
Member

ausi commented Aug 28, 2018

I think the correct command to update Contao is probably:

composer update --with-dependencies contao/*

or:

composer show --direct --name-only | grep ^contao/ | composer update --with-dependencies

@fritzmg
Copy link
Contributor Author

fritzmg commented Aug 28, 2018

The first command does not update dependencies for some reason:

$ composer update --with-dependencies contao/* --dry-run
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 9 updates, 0 removals
  - Updating contao/core-bundle (4.4.21) to contao/core-bundle (4.4.22)
  - Updating contao/calendar-bundle (4.4.21) to contao/calendar-bundle (4.4.22)
  - Updating contao/comments-bundle (4.4.21) to contao/comments-bundle (4.4.22)
  - Updating contao/faq-bundle (4.4.21) to contao/faq-bundle (4.4.22)
  - Updating contao/listing-bundle (4.4.21) to contao/listing-bundle (4.4.22)
  - Updating contao/installation-bundle (4.4.21) to contao/installation-bundle (4.4.22)
  - Updating contao/manager-bundle (4.4.21) to contao/manager-bundle (4.4.22)
  - Updating contao/news-bundle (4.4.21) to contao/news-bundle (4.4.22)
  - Updating contao/newsletter-bundle (4.4.21) to contao/newsletter-bundle (4.4.22)

The second one does however:

$ composer show --direct --name-only | grep ^contao/ | composer update --with-dependencies --dry-run
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 12 updates, 0 removals
  - Updating symfony/symfony (v3.4.14) to symfony/symfony (v3.4.15)
  - Updating doctrine/cache (v1.7.1) to doctrine/cache (v1.8.0)
  - Updating doctrine/persistence (v1.0.0) to doctrine/persistence (v1.0.1)
  - Updating contao/core-bundle (4.4.21) to contao/core-bundle (4.4.22)
  - Updating contao/installation-bundle (4.4.21) to contao/installation-bundle (4.4.22)
  - Updating contao/manager-bundle (4.4.21) to contao/manager-bundle (4.4.22)
  - Updating contao/calendar-bundle (4.4.21) to contao/calendar-bundle (4.4.22)
  - Updating contao/comments-bundle (4.4.21) to contao/comments-bundle (4.4.22)
  - Updating contao/faq-bundle (4.4.21) to contao/faq-bundle (4.4.22)
  - Updating contao/listing-bundle (4.4.21) to contao/listing-bundle (4.4.22)
  - Updating contao/news-bundle (4.4.21) to contao/news-bundle (4.4.22)
  - Updating contao/newsletter-bundle (4.4.21) to contao/newsletter-bundle (4.4.22)

@aschempp
Copy link
Member

aschempp commented Sep 3, 2018

Currently you simply have to update all bundles by selecting them in the manager. I have a POC of UI improvements for that, but nothing yet implemented.

@leofeyer leofeyer modified the milestones: 4.4.22, 4.4 May 14, 2019
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
leofeyer pushed a commit that referenced this issue Nov 8, 2021
Description
-----------

This includes most of the features discussed in #3097 (comment)

Commits
-------

6a63d40 Added support for canonical link handling to html head bag
8849810 Allow to set canonical url manually
bfe8f29 Added support for parameter wildcards
c9bde3e Added back end integration
e737edf Bye $GLOBALS['TL_NOINDEX_KEYS']
a02c18f Implemented output of rel="canonical"
902d705 Different field order
72b18be Fixed tests
b3ba34d Merge branch '4.x' into feature/canonical
a9634a5 Update core-bundle/src/Resources/contao/languages/en/tl_page.xlf

Co-authored-by: Fritz Michael Gschwantner <fmg@inspiredminds.at>
47b0409 Update core-bundle/src/Resources/contao/templates/frontend/fe_page.html5

Co-authored-by: Fritz Michael Gschwantner <fmg@inspiredminds.at>
a58098b Update core-bundle/src/Routing/ResponseContext/HtmlHeadBag/HtmlHeadBag.php

Co-authored-by: M. Vondano <m-vo@users.noreply.github.com>
22d8d49 Make sure the custom canonical URI can be retrieved as is
627ab48 Normalize custom URI as well
9122bea Fixed CI
e6f6fbd Merge branch '4.x' into feature/canonical
2dd6e97 Merge branch '4.x' into feature/canonical
06ea58a CS
1acca17 Use the request object instead of the Environment class
4ac1409 CS
4eb4a05 Also add the base path
e8c7d40 Merge pull request #7 from leofeyer/feature/canonical-without-environment

Use the request object instead of the Environment class
f595819 Merge branch '4.x' into feature/canonical
bdfcb55 Disable the canonical fields instead of adding them dynamically (#9)
cd936ea Remove the block around the canonical tag (#10)
leofeyer added a commit that referenced this issue Feb 2, 2024
…method (see #6833)

Description
-----------

Fixes #6824

Now that we have merged #6645, we can revert these changes.

Commits
-------

ea67382 Revert the changes to the `Controller::getParentEntries()` method
ef335ed Also check the ptable in the SQL query
7db085f Fix getParentEntries() (see #10)

Co-authored-by: ausi <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

No branches or pull requests

4 participants