Closed thomaslanenh closed 2 years ago
can you try beta.7 of acorn?
Same error(s) unfortunately :( Unless I updated to the beta revision wrong.
Can you try clearing the wp-content/cache/acorn directory? (after upgrading to beta.7)
Hmmm, I don't actually have a wp-content/cache folder. Maybe therein lies the issue?
yea, sage/acorn beta is all over the place the past month.
how about in themes/sage/storage/framework/cache?
delete packages.php
and services.php
and then wp acorn optimize
and then try doing a field again
So I tried that and I think it provided a different error now...a critical one rip. Thanks for your help btw.
`PHP Fatal error: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable. in /app/wp-content/themes/sage/vendor/illuminate/container/Container.php:1093 Stack trace:
Fatal error: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable. in /app/wp-content/themes/sage/vendor/illuminate/container/Container.php:1093 Stack trace:
Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.`
does wp acorn optimize:clear
work or is the CLI broken entirely?
how old is your project? can you update it to have parity with the latest sage 10? have you customized your sage 10 configs? if so can you delete them all so it has parity with dev-main
It works. Interestingly, the acf actions now appear when you do wp acorn list
, which weren't before. But when you try to use one you get a fatal error.
From this morning lol. I'll try deleting those and report back in.
Okay so...I downloaded Sage 10 beta 2 and overwrote my existing files. That seemed to allow wp acorn acf:field Example
to work! But it doesn't actually work. It's getitng me to a problem I had with ACF Builder and Sage 9. It doesn't seem to be actually doing anything. Which I presume makes sense now that ACF composer is working i'm back to my ACF Builder bug?
Thanks
thats really strange it wouldn't be working.. are you on the latest ACF Pro? all of the stubs generated should work out of the box (e.g. add a field to Post, or create an example Block)
Yep. It does it both for Sage 9 and Sage 10, using Trellis / Bedrock & not using them, which makes me think maybe i missed something. It seems like setup.php just doesn't get run or something? Or does regular ACF need to be installed in addition to Pro?
nope just pro and make sure its activated of course. you don't have to do anything special. 😕
can you try an options page? or a block? nothing works?
That's the odd thing; it gets created but nothing gets reflected on the actual site. :(
So:
`www-data@3f8e438a1783:/app$ wp acorn acf:block TestBlock
🎉 TestBlock block successfully composed. ⮑ app/Blocks/TestBlock.php ⮑ resources/views/blocks/test-block.blade.php`
app/blocks/TestBlock.php produces:
`<?php
namespace App\Blocks;
use Log1x\AcfComposer\Block; use StoutLogic\AcfBuilder\FieldsBuilder;
class TestBlock extends Block { /**
@var string */ public $name = 'Test Block';
/**
@var string */ public $description = 'A simple Test Block block.';
/**
@var string */ public $category = 'formatting';
/**
@var string|array */ public $icon = 'editor-ul';
/**
@var array */ public $keywords = [];
/**
@var array */ public $post_types = [];
/**
@var array */ public $parent = [];
/**
@var string */ public $mode = 'preview';
/**
@var string */ public $align = '';
/**
@var string */ public $align_text = '';
/**
@var string */ public $align_content = '';
/**
@var array */ public $supports = [ 'align' => true, 'align_text' => false, 'align_content' => false, 'full_height' => false, 'anchor' => false, 'mode' => false, 'multiple' => true, 'jsx' => true, ];
/**
@var array */ public $styles = [ [ 'name' => 'light', 'label' => 'Light', 'isDefault' => true, ], [ 'name' => 'dark', 'label' => 'Dark', ] ];
/**
@var array */ public $example = [ 'items' => [ ['item' => 'Item one'], ['item' => 'Item two'], ['item' => 'Item three'], ], ];
/**
@return array */ public function with() { return [ 'items' => $this->items(), ]; }
/**
@return array */ public function fields() { $testBlock = new FieldsBuilder('test_block');
$testBlock
->addRepeater('items')
->addText('item')
->endRepeater();
return $testBlock->build();
}
/**
@return array */ public function items() { return get_field('items') ?: $this->example['items']; }
/**
and views.../TestBlock.php produces: `
@else
{{ $block->preview ? 'Add an item...' : 'No items found!' }}
@endif
But nothing appears on the site. It's very odd. ACF Builder I was having the same issue with both Sage 9 and Sage 10 in that it wouldn't actually do anything after setting it up. If I try to reinstall ACF Builder now though I get:
`composer require stoutlogic/acf-builder --with-all-dependencies Using version ^1.12 for stoutlogic/acf-builder ./composer.json has been updated Running composer update stoutlogic/acf-builder --with-all-dependencies Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages.
Problem 1
You can also try re-running composer require with an explicit version constraint, e.g. "composer require stoutlogic/acf-builder:*" to figure out if any version is installable, or "composer require stoutlogic/acf-builder:^2.1" if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to their original content. `
does anything related to ACF work in your environment? can you use get_field('test')
or does it throw the function not existing? is it showing up in the backend? the above error is just composer being dumb. try running composer upgrade
first - but regardless, you don't need to bring in acf-builder. acf-composer already does.
So, interesting, that block i created worked! So it just seems anything involving the FieldBuilder that isn't a Block related doens't for some odd reason? Like I can even see the Item repeater in the test block but not in the field, unless i'm being a idiot and not looking in the right area (which is totally possible lol)
edit: I got it back, somehow acf composer got uninstalled; above error still applies
on a fresh Bedrock & Sage 10 install I get my test field at the bottom of the block editor:
Does the field show up in Gutenberg Preferences (Top right Gear -> Preferences)?
Woah, it just randomly started working after it uninstalled itself and I reinstalled it. I don't know what caused that to make it kick in and work but thank you for all the help. If there's anything I can send you to help asisst if this is a repeatable issue.
glad you got it working! sounds like some dependency hell or something weird with caching. Acorn might've played a part in this (at least on Sage 10) but will be fixed in beta 8 or 9 in entirety.
`PHP Fatal error: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable. in /app/wp-content/themes/sage/vendor/illuminate/container/Container.php:1093 Stack trace:
0 /app/wp-content/themes/sage/vendor/illuminate/container/Container.php(886): Illuminate\Container\Container->notInstantiable('Illuminate\Cont...')
1 /app/wp-content/themes/sage/vendor/illuminate/container/Container.php(758): Illuminate\Container\Container->build('Illuminate\Cont...')
2 /app/wp-content/themes/sage/vendor/roots/acorn/src/Illuminate/Foundation/Application.php(841): Illuminate\Container\Container->resolve('Illuminate\Cont...', Array, true)
3 /app/wp-content/themes/sage/vendor/illuminate/container/Container.php(694): Illuminate\Foundation\Application->resolve('Illuminate\Cont...', Array)
4 /app/wp-content/themes/sage/vendor/roots/acorn/src/Illuminate/Foundation/Application.php(826): Illuminate\Container\Container->make('Illuminate\Cont...', Array)
5 /app/wp in /app/wp-content/themes/sage/vendor/illuminate/container/Container.php on line 1093
Fatal error: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable. in /app/wp-content/themes/sage/vendor/illuminate/container/Container.php:1093 Stack trace:
0 /app/wp-content/themes/sage/vendor/illuminate/container/Container.php(886): Illuminate\Container\Container->notInstantiable('Illuminate\Cont...')
1 /app/wp-content/themes/sage/vendor/illuminate/container/Container.php(758): Illuminate\Container\Container->build('Illuminate\Cont...')
2 /app/wp-content/themes/sage/vendor/roots/acorn/src/Illuminate/Foundation/Application.php(841): Illuminate\Container\Container->resolve('Illuminate\Cont...', Array, true)
3 /app/wp-content/themes/sage/vendor/illuminate/container/Container.php(694): Illuminate\Foundation\Application->resolve('Illuminate\Cont...', Array)
4 /app/wp-content/themes/sage/vendor/roots/acorn/src/Illuminate/Foundation/Application.php(826): Illuminate\Container\Container->make('Illuminate\Cont...', Array)
5 /app/wp in /app/wp-content/themes/sage/vendor/illuminate/container/Container.php on line 1093`
Attempted to follow the set up guide but any
wp acorn acf:field Example
commands run produce this error.