Project

General

Profile

Actions

Task #64122

closed

Options for RteFileLinksUpdateWizard in Upgrade Wizard

Added by Urs Braem over 9 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Install Tool
Target version:
Start date:
2015-01-05
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

The 4.5->6.2 Upgrade Wizard often stalls at the "Migrate all file links of RTE-enabled fields to FAL" step, because of found broken file links.

Some are really broken and need to be fixed, but some are just old, e.g. lying in visible CEs on hidden pages.

Of course, it would be good to clean up such unused content upon upgrading, but it can be difficult to figure out what can be deleted, which can disrupt the workflow/schedule.

Is there a way to skip these broken links and proceed to the next step of the upgrade wizard?
Or a better solution?


Files

Actions #1

Updated by Urs Braem over 9 years ago

For easier debugging, I've added a few lines In RteFileLinksUpdateWizard.php, so that the error message can be copied as a csv and also shows the page the CE is on

    /**
     * Tries to fetch the file object corresponding to the given path.
     *
     * @param string $path Path to a file (starting with "fileadmin/")
     * @param array $reference Corresponding sys_refindex entry
     * @return null|\TYPO3\CMS\Core\Resource\FileInterface
     */
    protected function fetchReferencedFile($path, array $reference) {
        $fileObject = NULL;
        if (@file_exists(PATH_site . '/' . $path)) {
            try {
                $fileObject = $this->storage->getFile(
                    '/' . str_replace(
                        $this->fileAdminDir,
                        '',
                        $path
                    )
                );
            } catch (\TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException $notFoundException) {
                // This should really not happen, since we are testing existence of the file just before
                $this->errors[] = $path . ' not found (referenced in element ' . $reference['recuid'] . ' of table ' . $reference['tablename'] . ' in field ' . $reference['field'] . ')';
            }
        } else {
            // Nothing to be done if file not found
            // edit: show pid of the content element for easier manual fixing
            $page = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
                'pid',
                $reference['tablename'],
                'uid = \''.$reference['recuid'].'\''
            );
            $this->errors[] = 'File not found (page / uid / path / table / field): '
                . $page[0]['pid'] . ','
                . $reference['recuid'] . ','
                . $path . ','
                . $reference['tablename'] . ',' 
                . $reference['field'];
            // end edit
        }
        return $fileObject;
    }


Like this, you can create a spreadsheet, sort via pid and go through all the things manually, even send it to editors to go through:
File not found (page, uid, path, table, field): 174,317,fileadmin/public/Path/to/file/name.pdf,tt_content,bodytext
File not found (page, uid, path, table, field): 174,314,fileadmin/public/Path/to/file/name.pdf,tt_content,bodytext
Actions #2

Updated by Markus Klein over 9 years ago

  • Tracker changed from Feature to Task
  • TYPO3 Version set to 6.2

Can you please push your suggestion to Gerrit?

Actions #3

Updated by Urs Braem over 9 years ago

Ok, I'm onto it, following http://wiki.typo3.org/Contribution_Walkthrough_with_CommandLine. But now I just get the master branch if I do it following the walkthrough.

Can you give me a hand on how to clone and work on theTYPO3_6-2 branch?
http://stackoverflow.com/questions/67699/clone-all-remote-branches-with-git has had me a little confused on that

Actions #4

Updated by Markus Klein over 9 years ago

This patch is a special case, where we don't need a patch for master first. The code does not exist there anymore.

So just you basically need to: * Clone the Core (use http://www.wwwision.de/githelper/) * git checkout TYPO3_6-2 * do your modifications * git commit (http://wiki.typo3.org/CommitMessage_Format_%28Git%29) * git push origin HEAD:refs/for/TYPO3_6-2

Actions #5

Updated by Gerrit Code Review over 9 years ago

  • Status changed from New to Under Review

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35804

Actions #6

Updated by Urs Braem over 9 years ago

Awesome, thanks a lot, Markus! I think I've got it.
For the first step (Clone the core), I simply used

git clone git://git.typo3.org/Packages/TYPO3.CMS.git typo3_src-git 

anything else worked fine with your instructions and the walkthrough.

Actions #7

Updated by Urs Braem over 9 years ago

Ah Markus sorry, I think I was so excited I did this that I replaced the wrong part of the code! :-)

How do I discard that commit from gerrit so I can push the right one?
Or simply do it right and commit again? But with the same commit message?

PS: using sublime, will install a plugin to remove trailing whitespace

Actions #8

Updated by Gerrit Code Review over 9 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35805

Actions #9

Updated by Markus Klein over 9 years ago

On gerrit you can abandon a change completely if you don't like it anymore.
If you want to improve one, just push a new patch set but keep the change-id.

The easiest way to do it is to have a clean local branch, then use the download link provided by gerrit (right-top, cherry-pick), pasting the link on the commandline which will then put that very commit on top of the current branch, then edit your files, commit the stuff with "git commit --amend" (which overwrites the last commit) and then push the result back go gerrit as usual. You will finally have a second patch set visible on gerrit. Finally clean your local branch again by reseting it. (e.g. by running 'git reset --hard HEAD~1')

Regarding the IDE. Give PHPStorm a shot (evaluation license). You'll never ever touch sublime (or any other editor) again for PHP programming, I promise. It is worth every cent. Alternatively you may use Netbeans, which is free.

Actions #10

Updated by Gerrit Code Review over 9 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35837

Actions #11

Updated by Gerrit Code Review over 9 years ago

Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35837

Actions #12

Updated by Gerrit Code Review over 9 years ago

Patch set 3 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35837

Actions #13

Updated by Gerrit Code Review over 9 years ago

Patch set 4 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35837

Actions #14

Updated by Anonymous over 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #17

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF