Skip to content
This repository has been archived by the owner on Feb 13, 2022. It is now read-only.

Commit

Permalink
🥅 errors related to editor plugin
Browse files Browse the repository at this point in the history
Signed-off-by: Bruno Meilick <b@bnomei.com>
  • Loading branch information
bnomei committed Mar 1, 2020
1 parent a981758 commit 996fade
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 67 deletions.
24 changes: 16 additions & 8 deletions classes/Kirby/Editor/SrcsetBlock.php
Expand Up @@ -4,15 +4,23 @@

use Throwable;

if (!class_exists('Kirby\Editor\Block')) {
load([
'kirby\\editor\\block' => realpath(__DIR__ . '/../../../../') . '/editor/lib/Block.php',
]);
$foundEditor = false;
foreach([realpath(__DIR__ . '/../../../../'), realpath(__DIR__ . '/../../../tests/site/plugins/')] as $dir) {
if (is_dir( $dir . '/editor')) {
foreach(['Block', 'Blocks'] as $lib) {
if (! class_exists("Kirby\Editor\{$lib}")) {
load([
"Kirby\\Editor\\{$lib}" => $dir . "/editor/lib/{$lib}.php",
]);
}
$foundEditor = true;
break;
}
}
}
if (!class_exists('Kirby\Editor\Blocks')) {
load([
'kirby\\editor\\blocks' => realpath(__DIR__ . '/../../../../') . '/editor/lib/Blocks.php',
]);

if (! $foundEditor) {
class Block {}
}

// TODO: no coverage since no real tests
Expand Down
2 changes: 1 addition & 1 deletion composer.json
@@ -1,7 +1,7 @@
{
"name": "bnomei/kirby3-srcset",
"type": "kirby-plugin",
"version": "3.3.1",
"version": "3.3.2",
"license": "MIT",
"description": "Kirby 3 Plugin for creating lazyloading image srcset",
"authors": [
Expand Down
115 changes: 57 additions & 58 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 996fade

Please sign in to comment.