Post-install fixes of sevenx_multisite
This page is for developers who maintain or copy the sevenx_multisite installer, and for administrators who want to
understand a log line from the install. It answers: what the two hook files do, and what each repair after the
content import is for. The step numbers refer to the table on
The multisite installer script.
Contents
- install-scripts.php
- post-install-fix.php
- Repairs of the imported data
- Nodes, layouts, menus and tags
- URL aliases and site prefixes
- Class names
- Reading the log
install-scripts.php
settings/install-scripts.php defines the two hooks CreateSites (kernel/setup/steps/ezstep_create_sites.php)
calls around the package install:
function eZSitePreInstall( )
{
$installer = new sevenxMultiSiteInstaller( array( 'var_dir' => 'var/site' ) );
$installer->preInstall();
}
function eZSitePostInstall( &$parameters )
{
$installer = new sevenxMultiSiteInstaller( $parameters );
$installer->postInstall();
}CreateSites calls eZSitePreInstall( $siteType ) after including the settings files and before it installs the
required packages, and eZSitePostInstall( $parameters ) at the end, with the content language temporarily set to
the clean data's language ("in the primary language every dataMap() of an eng-US object came back empty"). After the
post-install it checks eZSiteInstaller::abortedStep() and reports EZSW-080 when a step stopped the chain. What
preInstall() does is on The multisite installer script.
post-install-fix.php
settings/post-install-fix.php (1050 lines) is loaded by the installer with require_once; it is not a
<settings-file>. Its header says why it is separate: "Keep all non-interactive DB normalization here so the
installer and build_reference can share the same logic." Every function is wrapped in if ( !function_exists(...) ).
| Function | Used by step | Purpose |
|---|---|---|
sevenxSitePackageName() | the folder name above settings/: sevenx_multisite or sevenx_multisite_clean | |
sevenxDemocontentPackageName() | the required package whose name starts with sevenx_multisite_democontent, read from the site package's package.xml | |
sevenxDemocontentObjectDir() | that package's ezcontentobject/ folder in the repository | |
sevenxFixPackageNodesAndExplayouts() | 35 | nodes, layout references, menus, tags, embeds, cache |
sevenxSetSiteInfoMenuNodeIDs() | a stub that returns true | |
sevenxFixMenuINIFiles() | 35 | menu.ini.append.php of each site siteaccess |
sevenxClearLinksToContentNotInstalled() | 40 | block links to missing pages |
sevenxCleanStaleUrlTextAttributes() | 37 | stale url_text values |
sevenxRegenerateURLAliases() | 38 | URL aliases of every node |
sevenxFixEmbeddedObjectIDs() | 35 | <embed> and <embed-node> ids in rich text |
sevenxFixEzTagsFromPackage() | 35 | tag attributes |
sevenxRepairClassNameLists() | 45 | class name lists keyed by number |
"The only difference between the two installations is the content package the site package requires", so the same
file serves sevenx_multisite and sevenx_multisite_clean.
Repairs of the imported data
These steps run early, because they only need the objects and "several later steps are fragile":
| Step | Repair |
|---|---|
3 postInstallFixContentObjectNameLanguages | puts the language id of every ezcontentobject_name and ezcontentobject_attribute row in line with its locale, keeping the always-available bit, then rebuilds the language masks of versions and objects from their attributes. Without it, lookups that join the name table miss and "executeSteps aborts the rest of the install" |
4 postInstallResolveRelationListIds | relation list items arrive as <relation-item contentobject-remote-id="...">; each attribute is rebuilt through the datatype's fromString() with real object ids, and targets that are not installed are dropped |
5 postInstallRekeyStarRatings | moves the seeded ezstarrating row onto the installed "Test Product" (remote id af35e1174dab340acaddcff36cea57d3) and restores its average of 4.3 |
41 postInstallPlaceOrphanedPackageObjects | gives a node to any package object that was published without one, reading the parent from the object file, in two passes |
Nodes, layouts, menus and tags
Step 35 calls sevenxFixPackageNodesAndExplayouts(), which:
- Reads the node assignments of every
object-media-o-*.xmlof the content package and creates the nodes that are still missing, resolving parents by remote id, in up to 50 passes. This builds the map from package node and object ids to the ids of this installation. - Remaps the
explayouts_*andeztags_attribute_linkreferences and removes those that point at content the package does not ship (see Layouts data and the share .dba files). sevenxFixMenuINIFiles(): writessettings/siteaccess/<sa>/menu.ini.append.phpforsite,eng,sevenx_site_user(Fit & Healthy) andbold,bold_ger(Bold Agency), with[SiteInfo]RemoteID(media-o-site-infoormedia-o-site-info-bold),MainMenuID[],NexusMainMenuID[],FooterMenuID[],NexusFooterMenuID[],PrivacyPolicyIDandCookiePolicyID. Each list starts with a bareKey[]line so it replaces the theme's list instead of being appended to it; a page the package did not install is left out. The ids are written into the project's siteaccess settings, not into the theme extension.sevenxFixEzTagsFromPackage(): stores everyeztagsattribute again from the strings in the object file, and raises the priority of rule 50 to 175.sevenxFixEmbeddedObjectIDs(): rewrites numericobject_idandnode_idof embeds inezxmltextfields.- Clears all caches with
eZCache::clearAll(), because "the first page views were served from caches built before these fixes".
The installer method then clears the layout resolver cache.
URL aliases and site prefixes
Each site lives below its own home node and hides it with PathPrefix, so its URLs need aliases that start with the
prefix:
| Step | What it does |
|---|---|
37 postInstallCleanUrlText | empties url_text values that do not match the object's name (showcase pages keep theirs) |
38 postInstallRegenerateURLAliases | calls updateSubTreePath() for every node except node 1, without emptying the alias tables first: emptying them "removes the root elements the content tree hangs from" |
39 postInstallCreateSitePrefixAliases | stores the prefixed path of every node below media-n-939 and media-n-940, per language of the home node, never touching the home node's own element |
42 postInstallSetSiteHomeAndPrefix | writes ForceVirtualHost=true, PathPrefix, IndexPage, DefaultPage and RootNodeDepth for site, bold, bold_ger and the translations, copies the menus to the translations, and points the empty path alias at the Fit & Healthy home |
Class names
| Step | Repair |
|---|---|
44 postInstallResyncContentClassNames | rebuilds ezcontentclass.serialized_name_list from the ezcontentclass_name rows for classes whose list holds no name, so class lists and create menus stop showing a blank |
45 postInstallRepairClassNameLists | moves names and descriptions stored under key 0 (written while no content language existed) to the class's language; idempotent |
Reading the log
The fixes log through eZDebug::writeNotice(), one summary line each, for example "Created N missing tree nodes in N
pass(es)", "References to content ... does not ship, removed: ...", "Regenerated URL aliases for N nodes, N changed",
"Stored N prefixed URL alias path(s)", "Switched off N block link(s) to pages this installation does not have". On a
clean install the "removed" counts are expected; on a full install they should be zero.
Related pages
- sevenx_multisite
- The multisite installer script
- Install scripts in a site package
- Changing the installer script
- Site packages: start here
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.