Installing and Updating MetaModels

General Information about Installation

MetaModels consists of several modules that need to be installed depending on the task at hand.

In the Contao Manager under Packages, entering metamodels/ will list all available MetaModels packages. The base package metamodels/core must be installed — in addition, further attributes and filters are necessary depending on the task. A checklist is available for getting started with MetaModels.

In addition to the individual packages, there are bundles that combine various packages for a simplified installation.

For getting started with MetaModels, the bundle metamodels/bundle_start is recommended — this installs the core as well as the most important attributes and filters.

There is also the bundle metamodels/bundle_all, which installs the multilingual packages in addition to bundle_start (note: the packages translatedselect and translatedtags are no longer included here since MM 2.1, as they should only be used for special cases).

The two bundles are only intended for evaluation or first steps — in a live system, only the core and the necessary attributes and filters should be installed as separate packages.

Additional modules such as “register filter”, “perimeter search”, “rating” etc. must be added as separate packages — see Extensions.

See also

If installing via the Contao Manager and packages are already installed that contain an old MultiColumnWizard (MCW) package, the manager (or Composer) cannot replace and install at the same time. As a workaround, first mark all existing extension packages for an update, then add the MM package(s) and apply; alternatively, run composer update on the console — see ‘Forum’.

In addition to the Contao Manager, packages and bundles can be installed directly via the console using Composer — for example with

php public/contao-manager.phar.php composer require metamodels/core

or

php public/contao-manager.phar.php composer require metamodels/bundle_start

Instead of php, the path to the appropriate PHP binary may need to be specified — see Symfony and MM 2.x Tips.

After installation, don’t forget to update the database via the Contao install tool!

Further information about the individual versions of MetaModels follows.

Version Overview

Installation of MM 2.4 for Contao 5.3 and PHP 8

MetaModels 2.4 brings full compatibility with Contao 5.3 and PHP 8.2. MM 2.4 is an adaptation of version 2.3 to the new Contao and PHP version and of course brings all changes and features from MM 2.3.

The installation requirements for MetaModels 2.4 are:

  • a running Contao 5.3.x (LTS)

  • PHP 8.2 or higher

  • MySQL 5.5.5 or higher (InnoDB), MariaDB (including “strict mode”)

  • memory_limit 512MB or more (recommended)

  • until release, access key via the EAPMM Core is already freely available

  • for smaller projects, Package “Basic 1” is available

Higher versions of Contao and/or PHP may be possible but are not officially supported.

For an upgrade or new installation, note the changes and new features of MM 2.4 as well as the workflow with the schema manager and XLIFF translations Symfony Translation.

See also

During the development phase, packages provided via git receive new filenames with every change. These are stored in the composer.lock. This can cause composer install to fail to find packages and display an error message.
In that case, please run composer update to update the composer.lock.

Package dependencies are not entered as DEV version — this may mean that, for example, you need to manually add attribute_numeric for attribute_timestamp to the composer.json. Support is available for questions.

If the update shows the message
The checksum verification of the file failed...
please delete the composer.lock and restart the update.

If an update has problems, clearing the Composer cache may help: composer clearcache.

If you see the message
... Failed to connect to packages.cyberspectrum.de port 443: Connection refused...
or
... The "https://token:XXX@packages.cyberspectrum.de/r/packages.json" file could not be downloaded (HTTP/2 404 )...
then the Packagist server is very likely down and Composer cannot pull the packages. Please try the update again after a few minutes or contact the MM team.

After an upgrade, please delete the session data for the user in the backend to avoid displaying “pseudo errors”. To do this for all users, set the session column to NULL in the tl_user table. The error message looks like this:
Cannot assign null to property ContaoCommunityAlliance\DcGeneral\Panel\DefaultLimitElement::$intAmount of type int

The site should be fully tested before going live. MM 2.4 can be installed via Composer (console) or the Contao Manager. Access to the currently protected repository is available through our “early adopter program” — more information under Fundraising on the MM website.

Further features of MM 2.4:
We have compiled an overview page with the changes and features for MM 2.4 — please note the checklist when upgrading.

Installation of MM 2.3 for Contao 4.13 and PHP 8

MetaModels 2.3 brings full compatibility with Contao 4.13 and PHP 8.1. MM 2.3 is an adaptation of version 2.2 to the new Contao and PHP version and of course brings all changes and features from MM 2.2.

With the new schema manager and XLIFF files, the workflow with MM needs to be adjusted — see schema manager and Symfony Translation.

The installation requirements for MetaModels 2.3 are:

  • a running Contao 4.13.x (LTS)

  • PHP 8.1 or higher

  • MySQL 5.5.5 or higher (InnoDB), MariaDB (including “strict mode”)

  • memory_limit 512MB or more (recommended)

  • until release, access key via the EAPMM Core is already freely available

Higher versions of Contao and/or PHP may be possible but are not officially supported.

We have compiled an overview page with the changes and features for MM 2.3 — please note the checklist when upgrading.

The MM team also supports the work on DC_General with work and funding, which is responsible among other things for the displays in the backend in MM and brings many great features.

See also

For refinancing the extensive work, the MM team asks for financial support. A guideline should be the scope of the project to be realized, with approximately 10% calculated — based on the experience of recent contributions, these are amounts between €100 and €500 (net) — an invoice including VAT is always issued. More…

Notes and Instructions for Older Contao and MM Versions

Switching from metamodels/bundle_* to Separate Modules

When switching, e.g. from 2.0 to a newer version or for a new installation, it is a good opportunity to install only the attributes and filters that are necessary for the project. If, for example, metamodels/bundle_start or metamodels/bundle_all was previously in use, you can use the following SQL commands to query the actually used attributes and filters:

1-- Attributes
2SELECT type FROM `tl_metamodel_attribute` GROUP BY type ORDER BY type
3-- Attribute "levensthein" was renamed to "levenshtein"
4
5-- Filters
6SELECT type FROM `tl_metamodel_filtersetting` GROUP BY type ORDER BY type
7-- Filter rules "conditionand, conditionor, customsql, idlist, simplelookup" are included in MM Core
8-- Filter rule "checkbox_published" is in the Checkbox attribute

The resulting list can then be installed via the Contao Manager or the console, and unused modules can be left out.

Testing Special Packages

In addition to the currently available and released MetaModels packages, there are sometimes packages with bug fixes or new features that can/must be tested — for example, for the MetaModels core, this could be a package hotfix/2.1.25. The packages can be seen on Github in the corresponding repository (e.g. MetaModels/core) under the ‘branches’ tab. The designation shown there, such as hotfix/2.1.25, must be prefixed with dev- and suffixed with as 2.1.25.

An overview of the entries in composer.json here.

To test such a package, it must be explicitly specified in the Contao Manager with

dev-hotfix/2.1.25 as 2.1.25

or in composer.json

"metamodels/core": "dev-hotfix/2.1.25 as 2.1.25"

with its version.

Then run an update via the Contao Manager or on the console.

Since MetaModels is closely integrated with DC_General (DCG), testing often requires updating to a newer version here as well. The procedure is the same as for MetaModels, including the adjustment of the JSON entry with “as 2.1.x”.

The composer.json for implementing the packages for Core and DCG should have approximately the following entries in the “require” node (lines 8 and 10):

 1{
 2    "name": "local/website",
 3    "description": "A local website project",
 4    "type": "project",
 5    "license": "proprietary",
 6    "require": {
 7        "contao-community-alliance/composer-client": "~0.12",
 8        "contao-community-alliance/dc-general": "dev-hotfix/2.1.42 as 2.1.42",
 9        "metamodels/bundle_all": "^2.1",
10        "metamodels/core": "dev-hotfix/2.1.25 as 2.1.25",
11        ...
12    },
13    ...
14}

To return to the original state, reset the packages to their original specification e.g. “^2.1” and run an update including the database.

It is important to provide feedback to the developer or the MetaModels team via Github after a test.

Two further options are installing a fork or a pull request (PR). The composer.json must be adjusted for installation.

For a fork (if necessary, enter your own Github oAuth token in the package manager settings), e.g.

 1{
 2    "name": "local/website",
 3    "description": "A local website project",
 4    "type": "project",
 5    "license": "proprietary",
 6    "require": {
 7        "contao-community-alliance/composer-client": "~0.12",
 8        "contao-community-alliance/dc-general": "^2.1",
 9        "metamodels/bundle_all": "^2.1",
10        "byteworks/metamodelsattribute_multi": ">=1.0.5.0,<1.1-dev",
11        ...
12    },
13    ...
14    "repositories": [
15        ...
16        {
17            "type": "vcs",
18            "url": "https://github.com/byteworks-ch/contao-metamodelsattribute_multi.git"
19        },
20        {
21            "type": "git",
22            "url": "git@gitlab.com:MetaModels/filter_parent.git"
23        }
24    ],
25    ...
26}

or for a PR with the commit hash — which can be found on Github for the PR under the “Commits” tab.

 1{
 2    "name": "local/website",
 3    "description": "A local website project",
 4    "type": "project",
 5    "license": "proprietary",
 6    "require": {
 7        "contao-community-alliance/composer-client": "~0.12",
 8        "contao-community-alliance/dc-general": "^2.1",
 9        "metamodels/bundle_all": "^2.1",
10        "metamodels/attribute_alias": "dev-master#a97ec461ae1254fa616811c3ce234515238fb3c7 as 2.1.42",
11        ...