Bug #67228
closedFile indexing: Emit signal when file marked as missing?
100%
Description
It might be helpful to emit a signal when TYPO3\CMS\Core\Resource\Index\Indexer::detectMissingFiles()
finds a file is missing.
Any extension that adds capabilities concering file management might want to know about that.
This could be added at TYPO3\CMS\Core\Resource\Index\FileIndexRepository::markFileAsMissing()
and simply pass the $fileUid
from that function.
Updated by Frans Saris over 9 years ago
- Status changed from New to Accepted
Makes sense. Not sure if the setMissing() is currently centralized on one please. That needs to be checked.
Could you provide a patch and push it to the review system?
Updated by Gerrit Code Review over 9 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/39877
Updated by Christian Reiter over 9 years ago
- Add a listener that just writes to devlog
- Ensure FAL index is clean and up-to-date in a local test system
- Remove a file from fileadmin/ by manual action outside TYPO3 (Explorer, shell...)
- Run the task "File Abstraction Layer: Update storage index (scheduler)"
- Check devlog - entry should show up.
About centralizing "markAsMisssing" function:
There is an "on the fly" adding to index occuring when a folder is viewed in the File > List module. Any file created there from outside TYPO3 is newly added to the index.
However the other index actions, such as "markAsMissing" or updating on change, do not seem to be fired in this situation. They only occur on scheduler run.
Updated by Gerrit Code Review over 9 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/39877
Updated by Christian Reiter over 9 years ago
Hi,
what can I do to get the patch reviewed?
Example use case
When FileIndexRepository
emits the suggested signal "recordMarkedAsMissing" , a listener can check whether a different sys_file has a record with the same SHA1 as the missing one and possibly repair references.
Vice versa, when FileIndexRepository
emits the existing signal "recordCreated" the listener can check whether the newly added record has the same SHA1 as something that was previously marked missing.
When an external rename/move takes place, which case occurs depends on whether the indexer comes across the "missing" or "added" file first.
Capturing both ensures that any rename/move which does not simultaneously change the content can be "rescued" in terms of fixing references as well as avoiding record duplication, if an extension listening to the signals wants to do that.
Updated by Gerrit Code Review over 9 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/39877
Updated by Christian Reiter over 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset c54ac942f90098d216f8acdf38f6e142c4e1fba3.