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

Bad storage class error #171

Open
Sogl opened this issue Oct 31, 2022 · 0 comments
Open

Bad storage class error #171

Sogl opened this issue Oct 31, 2022 · 0 comments

Comments

@Sogl
Copy link

Sogl commented Oct 31, 2022

I develop on my MacbookPro, OS X Monterey, server installed using Grav Blog instruction, php 7.4. All works fine.
But on production server (CloudLinux) I see error during deployment (on bin/gpm install <anyplugin>) about my custom storage class:

In FlexDirectory.php line 996:

Bad storage class: Grav\Plugin\SoglFlex\Flex\Types\Users\UserFolderStorage

This line part on FlexDirectory.php:

if (!is_a($className, FlexStorageInterface::class, true)) {
    throw new \RuntimeException('Bad storage class: ' . $className);
}

Error shows on every plugin install:
image

My storage class:

<?php
declare(strict_types=1);

namespace Grav\Plugin\SoglFlex\Flex\Types\Users;

use Grav\Common\Flex\Types\Users\Storage\UserFolderStorage as DefaultUserFolderStorage;

/**
 * Class UserFolderStorage
 * @package Grav\Plugin\SoglFlex\Flex\Types\Users
 */
class UserFolderStorage extends DefaultUserFolderStorage
{
    /**
     * Prepares the row for saving and returns the storage key for the record.
     *
     * @param array $row
     */
    protected function prepareRow(array &$row): void
    {
        parent::prepareRow($row);
    }

    protected function initOptions(array $options): void
    {
        parent::initOptions($options);
    }

}

I changed Storage class to default (object: 'Grav\Common\Flex\Types\Users\UserObject') and now it works on production too.
But what kind of error is this?

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

No branches or pull requests

1 participant