Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to new Symfony cache classes #302

Closed
1 of 8 tasks
emteknetnz opened this issue Dec 13, 2021 · 5 comments
Closed
1 of 8 tasks

Migrate to new Symfony cache classes #302

emteknetnz opened this issue Dec 13, 2021 · 5 comments

Comments

@emteknetnz
Copy link
Member

emteknetnz commented Dec 13, 2021

Exception: HTML Parse Error: The "Symfony\Component\Cache\Simple\PhpFilesCache" class is deprecated since Symfony 4.3, use "Symfony\Component\Cache\Adapter\PhpFilesAdapter" and type-hint for "Symfony\Contracts\Cache\CacheInterface" instead. in /sites/cmstest-uat/releases/20211213214917/vendor/silverstripe/fulltextsearch/src/Search/Indexes/SearchIndex.php:502 Stack trace: #0 [internal function]: SilverStripe\FullTextSearch\Search\Indexes\SearchIndex->SilverStripe\FullTextSearch\Search\Indexes\{closure}(16384, 'The "Symfony\\Co...', '/sites/cmstest-...', 20, Array)

Saw warning on queuedjob message when manually running solr reindex job

I think it's blocking the indexing of content block content on AWS, possibly only when running PHP 8.0

Acceptance criteria

  • Warnings are visible in the output with failing the indexing tasks
  • The deprecated Symfony API is not used anymore
  • No module reference the old cache implementation
  • All modules that require symphony/cache, are constrained to using the relevant version of Symphony and the kitchen sink is installable.
  • The Fulltext Search cache still works.

PRs

@emteknetnz
Copy link
Member Author

emteknetnz commented Dec 14, 2021

Deprecation warning comes from

PhpFilesCache.php

@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.3, use "%s" and type-hint for "%s" instead.', PhpFilesCache::class, PhpFilesAdapter::class, CacheInterface::class), \E_USER_DEPRECATED);

class PhpFilesCache extends AbstractCache implements PruneableInterface

It turns into a full Exception in fulltextsearch SearchIndex.php

    protected function _getFieldValue($object, $field)
    {
        $errorHandler = function ($no, $str) {
            throw new Exception('HTML Parse Error: ' . $str);
        };
        set_error_handler($errorHandler, E_ALL);

@michalkleiner
Copy link
Contributor

Are we ok just with silencing this when getting the field content?

@emteknetnz
Copy link
Member Author

Yes. I've got a PR up, will test on an environment that was throwing the error shortly

@emteknetnz emteknetnz removed their assignment Dec 15, 2021
@maxime-rainville maxime-rainville self-assigned this Dec 15, 2021
@maxime-rainville
Copy link

Merged the PR as a stop gap. But it doesn't address the fundamental issue.

I've added some ACs. We can address this issue properly post release.

@emteknetnz
Copy link
Member Author

Can close this now - we're doing work to use new Symfony cache classes in silverstripe/silverstripe-framework#10478

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants