‪TYPO3CMS  10.4
TYPO3\CMS\Install\Updates\PopulatePageSlugs Class Reference
Inheritance diagram for TYPO3\CMS\Install\Updates\PopulatePageSlugs:
TYPO3\CMS\Install\Updates\UpgradeWizardInterface

Public Member Functions

string getIdentifier ()
 
string getTitle ()
 
string getDescription ()
 
bool updateNecessary ()
 
string[] getPrerequisites ()
 
bool executeUpdate ()
 

Protected Member Functions

 populateSlugs ()
 
bool checkIfWizardIsRequired ()
 
array getSuggestedSlugs (string $tableName, string $identityField='uid')
 
bool checkIfTableExists ($table)
 
array getSlugFieldConfig ()
 

Protected Attributes

string $table = 'pages'
 
string $fieldName = 'slug'
 

Detailed Description

Fills pages.slug with a proper value for pages that do not have a slug updater. Does not take "deleted" pages into account, but respects workspace records.

This is how it works:

  • ‪Check if realurl v1 (tx_realurl_pathcache) or v2 (tx_realurl_pathdata) has a page path, use that instead.
  • ‪If not -> generate the slug.

This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.

Definition at line 37 of file PopulatePageSlugs.php.

Member Function Documentation

◆ checkIfTableExists()

bool TYPO3\CMS\Install\Updates\PopulatePageSlugs::checkIfTableExists (   $table)
protected

Check if given table exists

Parameters
string$table
Returns
‪bool

Definition at line 261 of file PopulatePageSlugs.php.

References TYPO3\CMS\Install\Updates\PopulatePageSlugs\$table.

Referenced by TYPO3\CMS\Install\Updates\PopulatePageSlugs\populateSlugs().

◆ checkIfWizardIsRequired()

bool TYPO3\CMS\Install\Updates\PopulatePageSlugs::checkIfWizardIsRequired ( )
protected

Check if there are record within "pages" database table with an empty "slug" field.

Returns
‪bool
Exceptions

Definition at line 199 of file PopulatePageSlugs.php.

Referenced by TYPO3\CMS\Install\Updates\PopulatePageSlugs\updateNecessary().

◆ executeUpdate()

bool TYPO3\CMS\Install\Updates\PopulatePageSlugs::executeUpdate ( )

Performs the accordant updates.

Returns
‪bool Whether everything went smoothly or not

Implements TYPO3\CMS\Install\Updates\UpgradeWizardInterface.

Definition at line 103 of file PopulatePageSlugs.php.

References TYPO3\CMS\Install\Updates\PopulatePageSlugs\populateSlugs().

◆ getDescription()

string TYPO3\CMS\Install\Updates\PopulatePageSlugs::getDescription ( )
Returns
‪string Longer description of this updater

Implements TYPO3\CMS\Install\Updates\UpgradeWizardInterface.

Definition at line 66 of file PopulatePageSlugs.php.

◆ getIdentifier()

string TYPO3\CMS\Install\Updates\PopulatePageSlugs::getIdentifier ( )
Returns
‪string Unique identifier of this updater

Implements TYPO3\CMS\Install\Updates\UpgradeWizardInterface.

Definition at line 50 of file PopulatePageSlugs.php.

◆ getPrerequisites()

string [] TYPO3\CMS\Install\Updates\PopulatePageSlugs::getPrerequisites ( )
Returns
‪string[] All new fields and tables must exist

Implements TYPO3\CMS\Install\Updates\UpgradeWizardInterface.

Definition at line 91 of file PopulatePageSlugs.php.

◆ getSlugFieldConfig()

array TYPO3\CMS\Install\Updates\PopulatePageSlugs::getSlugFieldConfig ( )
protected

Load the TCA field configuration for the slug field and add further static fields to generatorOptions.

Returns
‪array

Definition at line 277 of file PopulatePageSlugs.php.

References TYPO3\CMS\Install\Updates\PopulatePageSlugs\$fieldName, $GLOBALS, and TYPO3\CMS\Install\Updates\PopulatePageSlugs\$table.

Referenced by TYPO3\CMS\Install\Updates\PopulatePageSlugs\populateSlugs().

◆ getSuggestedSlugs()

array TYPO3\CMS\Install\Updates\PopulatePageSlugs::getSuggestedSlugs ( string  $tableName,
string  $identityField = 'uid' 
)
protected

Resolve prepared realurl "pagepath" for pages

Parameters
string$tableName
string$identityField
Returns
‪array with pageID (default language) and language ID as two-dimensional array containing the page path

Definition at line 226 of file PopulatePageSlugs.php.

Referenced by TYPO3\CMS\Install\Updates\PopulatePageSlugs\populateSlugs().

◆ getTitle()

string TYPO3\CMS\Install\Updates\PopulatePageSlugs::getTitle ( )
Returns
‪string Title of this updater

Implements TYPO3\CMS\Install\Updates\UpgradeWizardInterface.

Definition at line 58 of file PopulatePageSlugs.php.

◆ populateSlugs()

TYPO3\CMS\Install\Updates\PopulatePageSlugs::populateSlugs ( )
protected

◆ updateNecessary()

bool TYPO3\CMS\Install\Updates\PopulatePageSlugs::updateNecessary ( )

Checks whether updates are required.

Returns
‪bool Whether an update is required (TRUE) or not (FALSE)

Implements TYPO3\CMS\Install\Updates\UpgradeWizardInterface.

Definition at line 78 of file PopulatePageSlugs.php.

References TYPO3\CMS\Install\Updates\PopulatePageSlugs\checkIfWizardIsRequired().

Member Data Documentation

◆ $fieldName

string TYPO3\CMS\Install\Updates\PopulatePageSlugs::$fieldName = 'slug'
protected

◆ $table

string TYPO3\CMS\Install\Updates\PopulatePageSlugs::$table = 'pages'
protected