fgtclb / file-required-attributes
Marks metadata fields required and disables file references if required fields are missing
Package info
github.com/fgtclb/typo3-file-required-attributes
Type:typo3-cms-extension
pkg:composer/fgtclb/file-required-attributes
Requires
- php: ^8.2 || ^8.3 || ^8.4 || ^8.5
- typo3/cms-backend: ^13.4.19 || ^14.3
- typo3/cms-core: ^13.4.19 || ^14.3
- typo3/cms-filelist: ^13.4.19 || ^14.3
- typo3/cms-filemetadata: ^13.4.19 || ^14.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.68
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5
- saschaegerer/phpstan-typo3: ^3.0
- sbuerk/fixture-packages: ^1.0
- typo3/testing-framework: ^9.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- 3.0.0
- dev-main / 3.x-dev
- 2.x-dev
- 2.0.2
- 2.0.1
- 2.0.0
- 1.x-dev
- v1.1.1
- v1.1.0
- v1.0.1
- 1.0.0
- dev-set-dev-version-3.0.1
- dev-release-3.0.0
- dev-task/add-publish-workflow
- dev-task/typo3-version-14
- dev-fix-for-schema-manager
- dev-task/prepare-release
- dev-task/prepare-release-2-0-1
- dev-task/missing-attribute-highlighting
- dev-task/adjust-13-support
- dev-task/update-typo3-support
- dev-add-own-node-types
This package is auto-updated.
Last update: 2026-11-03 17:00:57 UTC
README
What does it do?
This extension offers the ability to set metadata information as required. With required attributes, it provides the possibility to disable references having missing attributes.
If metadata is set in file reference, too, the file reference is updated.
If attribute only appears in metadata, a virtual field is added to reference, enforcing the ability to update metadata from reference. A warning, this change is made globally, is added to the field description.
Compatibility
| Extension | TYPO3 | PHP |
|---|---|---|
| 3.x | 13.4 (>= 13.4.19), 14.3 | 8.2 - 8.5 |
| 2.x | 12.4, 13.4 | 8.1 - 8.4 |
Installation
composer req fgtclb/file-required-attributes
How to use
Add required field registration in TCA/Overrides/sys_file_metadata.php inside
your extension:
<?php declare(strict_types=1); (static function (): void { \FGTCLB\FileRequiredAttributes\Utility\RequiredColumnsUtility::register( 'copyright', [ \TYPO3\CMS\Core\Resource\FileType::IMAGE->value, // ... ] ); \FGTCLB\FileRequiredAttributes\Utility\RequiredColumnsUtility::register( 'alternative', [ \TYPO3\CMS\Core\Resource\FileType::IMAGE->value, // ... ] ); \FGTCLB\FileRequiredAttributes\Utility\RequiredColumnsUtility::register( 'title', [ \TYPO3\CMS\Core\Resource\FileType::IMAGE->value, ] ); \FGTCLB\FileRequiredAttributes\Utility\RequiredColumnsUtility::register( 'description', [ \TYPO3\CMS\Core\Resource\FileType::IMAGE->value, ] ); })();
This extension will handle all required steps by itself, you don't need to handle with TCA.
A required column counts as missing when it is empty or holds only whitespace. A required radio, select
or check column also counts as missing on 0, the value of its "not set" item.
Supported Versions
| Version | Supported | End of Support |
|---|---|---|
| 3.x | ✅ | 2029-06-30 |
| 2.x | ✅ | 2027-12-31 |
| < 2.0 | ❌ | support ended |
Security
Found a vulnerability? Please report it privately via our security report form — do not open a public issue. See SECURITY.md for the full vulnerability disclosure policy, including what to expect and our safe harbor statement.
Simplified EU Declaration of Conformity (Annex VI)
Hereby, web-vision GmbH declares that the product with digital elements type FGTCLB File required attributes is in compliance with Regulation (EU) 2024/2847.
The full text of the EU declaration of conformity is available at the following internet address: https://security.fgtclb.com/conformity/fgtclb/file-required-attributes/2.1.0/en/
The full declarations are also included in this repository: English · Deutsch.
Create a release (maintainers only)
Prerequisites:
- git binary
- ssh key allowed to push new branches to the repository
- GitHub command line tool
ghinstalled and configured with user having permission to create pull requests. tailorandcomposerinstalled globally
Create release
Set
RELEASE_BRANCHto branch release should happen, for example: 'main'. SetRELEASE_VERSIONto release version working on, for example: '3.0.0'. SetDEV_VERSIONto the version following the release, for example: '3.0.1'.
Important
Requires GitHub cli tool with personal token and
maintainer permission on the extension repository.
echo '>> Create release' ; \ RELEASE_BRANCH='main' ; \ RELEASE_VERSION='3.0.0' ; \ DEV_VERSION='3.0.1' ; \ echo ">> Checkout branches" && \ git checkout ${RELEASE_BRANCH} && \ git fetch --all && \ git pull --rebase && \ echo ">> Create release ${RELEASE_VERSION}" && \ git checkout -b release-${RELEASE_VERSION} && \ sed -i "s/^COMPOSER_ROOT_VERSION.*/COMPOSER_ROOT_VERSION=\"${RELEASE_VERSION}\"/" Build/Scripts/runTests.sh && \ sed -i "s/^ RELEASE_VERSION.*/ RELEASE_VERSION='${RELEASE_VERSION}' ; \\\\/" README.md && \ sed -i "s/^ DEV_VERSION.*/ DEV_VERSION='${DEV_VERSION}' ; \\\\/" README.md && \ tailor set-version ${RELEASE_VERSION} && \ composer config "extra"."typo3/cms"."version" "${RELEASE_VERSION}" && \ echo "${RELEASE_VERSION}" > VERSION && \ git add . && \ git commit -m "[RELEASE] ${RELEASE_VERSION}" && \ git push --set-upstream origin release-${RELEASE_VERSION} && \ gh pr create --fill --base ${RELEASE_BRANCH} --title "[RELEASE] ${RELEASE_VERSION}" && \ sleep 10 && \ gh pr checks --watch --interval 2 && \ sleep 10 && \ gh pr merge -rd --admin && \ git remote prune origin && \ git tag ${RELEASE_VERSION} -m "${RELEASE_VERSION}" && \ git push origin ${RELEASE_VERSION} && \ echo ">> Post-release - set dev version: ${DEV_VERSION}-dev" && \ git checkout -b set-dev-version-${DEV_VERSION} && \ sed -i "s/^COMPOSER_ROOT_VERSION.*/COMPOSER_ROOT_VERSION=\"${DEV_VERSION}-dev\"/" Build/Scripts/runTests.sh && \ tailor set-version ${DEV_VERSION} && \ composer config "extra"."typo3/cms"."version" "${DEV_VERSION}-dev" && \ echo "${DEV_VERSION}-dev" > VERSION && \ git add . && \ git commit -m "[TASK] Set dev version ${DEV_VERSION}" && \ git push --set-upstream origin set-dev-version-${DEV_VERSION} && \ gh pr create --fill --base ${RELEASE_BRANCH} --title "[TASK] Set dev version \"${DEV_VERSION}-dev\"" && \ sleep 10 && \ gh pr checks --watch --interval 2 && \ sleep 10 && \ gh pr merge -rd --admin && \ git remote prune origin
Pushing the tag triggers the on push tags workflow (publish.yml), which creates the upload package and the
GitHub release with the package attached. The upload to the TYPO3 Extension Repository is not part of it and has
to be done by the owner of the extension key.
License
This extension is released under the GPL-3.0-or-later license.