Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
Adrian Mörchen

PHP Fatal error with acp/storage/file/directory after Upgrade to 6.3

Hello,

After the upgrade to 6.3.x we get an error on all pages using the filter to set the directory.
Removing the filter -> everything is okay.

add_filter( 'acp/storage/file/directory', function ( $directory ) {
    return WP_CONTENT_DIR . '/MY_CUSTOM_FOLDER/acp-settings';
} );

The error:

PHP Fatal error:  Uncaught LogicException: Call after theinit` hook. in [...]/wp-content/plugins/admin-columns-pro/admin-columns/classes/PostTypeRepository.php:23
Stack trace:
#0 [...]/wp-content/plugins/admin-columns-pro/admin-columns/classes/PostTypeRepository.php(15): AC\PostTypeRepository->find_all()
#1 [...]/wp-content/plugins/admin-columns-pro/admin-columns/classes/ListScreenFactory/PostFactory.php(39): AC\PostTypeRepository->exists('wp-taxonomy_kue...')
#2 [...]/wp-content/plugins/admin-columns-pro/admin-columns/classes/ListScreenFactory/PostFactory.php(34): AC\ListScreenFactory\PostFactory->is_supported_post_type('wp-taxonomy_kue...')
#3 [...]/wp-content/plugins/admin-columns-pro/admin-columns/classes/ListScreenFactory/Aggregate.php(39): AC\ListScreenFactory\PostFactory->can_create('wp-taxonomy_kue...')
#4 [...]/wp-content/plugins/admin-columns-pro/admin-columns/classes/ListScreenRepository/Database.php(144): AC\ListScreenFactory\Aggregate->can_create('wp-taxonomy_kue...')
#5 [internal function]: AC\ListScreenRepository\Database->create_list_screen(Object(stdClass))
#6 [...]/wp-content/plugins/admin-columns-pro/admin-columns/classes/ListScreenRepository/Database.php(164): array_map(Array, Array)
#7 [...]/wp-content/plugins/admin-columns-pro/admin-columns/classes/ListScreenRepository/Database.php(60): AC\ListScreenRepository\Database->create_list_screens(Array)
#8 [...]/wp-content/plugins/admin-columns-pro/admin-columns/classes/ListScreenRepository/ListScreenRepositoryTrait.php(37): AC\ListScreenRepository\Database->find_all_from_source()
#9 [...]/wp-content/plugins/admin-columns-pro/admin-columns/classes/ListScreenRepository/Storage/ListScreenRepository.php(51): AC\ListScreenRepository\Database->find_all()
#10 [...]/wp-content/plugins/admin-columns-pro/admin-columns/classes/ListScreenRepository/ListScreenRepositoryTrait.php(37): AC\ListScreenRepository\Storage\ListScreenRepository->find_all_from_source()
#11 [...]/wp-content/plugins/admin-columns-pro/classes/Service/Storage.php(109): AC\ListScreenRepository\Storage\ListScreenRepository->find_all()
#12 [...]/wp-content/plugins/admin-columns-pro/classes/Service/Storage.php(97): ACP\Service\Storage->run_migration(Object(AC\ListScreenRepository\Storage\ListScreenRepository), Object(AC\ListScreenRepository\Storage\ListScreenRepository))
#13 [...]/wp-content/plugins/admin-columns-pro/classes/Service/Storage.php(43): ACP\Service\Storage->configure_file_storage(Array)
#14 [...]/wp-includes/class-wp-hook.php(310): ACP\Service\Storage->configure(Object(ACP\AdminColumnsPro))
#15 [...]/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters('', Array)
#16 [...]/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#17 [...]/wp-content/plugins/admin-columns-pro/admin-columns-pro.php(58): do_action('acp/ready', Object(ACP\AdminColumnsPro))
#18 [...]/wp-includes/class-wp-hook.php(310): {closure}('')
#19 [...]/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array)
#20 [...]/wp-includes/plugin.php(517): WP_Hook->do_action(Array)`
1 year, 2 months ago
Stefan van den Dungen Gronovius
Developer

Thanks for your feedback. We’re able to reproduce the issue and it has something to do with our migration script.
I see that you’re using our File Storage feature and also have the migration hook enabled.

add_filter('acp/storage/file/directory/migrate', '__return_true');

This is mentioned in our documentation here:
https://docs.admincolumns.com/article/58-how-to-setup-local-storage#migrate

This hook is meant to run once and it will migrate all the database settings to the given folder.
After that, it should not be necessary to have the hook enabled.
In your use case, you can remove the migration hook from your installation.
In the meantime, we will make sure that this issue is fixed in the next release.

1 year, 2 months ago
Adrian Mörchen

Thanks, this worked 👍

I had the migration hook enabled in the wrong file, so I haven’t seen it.

1 year, 2 months ago

You must be logged in to reply to this topic.