Open Victor-Miguel1405 opened 1 month ago
Hmm, I'm not sure what's happening. No one else has reported these issues before 🤔
What does your app/Providers/AppServiceProvider.php
file look like? Are you calling Json::withoutWrapping()
anywhere?
My AppServiceProvider.php :::
<?php
namespace App\Providers;
use App\Markdown\SpanExtension;
use App\Rules\Fqdn;
use DeviceDetector\DeviceDetector;
use Illuminate\Http\Client\PendingRequest;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\ServiceProvider;
use Request;
use Statamic\Facades\Markdown;
use Statamic\Statamic;
use Studio1902\PeakSeo\Handlers\ErrorPage;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
Statamic::vite('app', [
'resources/css/cp.css',
]);
ErrorPage::handle404AsEntry();
Markdown::addExtension(fn () => new SpanExtension('|'));
$this->bootValidator();
$this->bootMacros();
}
public function bootValidator()
{
$rules = [
'fqdn' => Fqdn::class,
];
foreach ($rules as $name => $class) {
$rule = new $class;
$extension = static function ($attribute, $value) use ($rule) {
return $rule->passes($attribute, $value);
};
$this->app['validator']->extend($name, $extension, $rule->message());
}
}
public function bootMacros()
{
Request::macro('device', function (): ?DeviceDetector {
/** @var Request $self */
$self = $this;
$cache = cache()->driver('array');
return $cache->rememberForever('request-device-'.spl_object_id($self), function (): DeviceDetector {
$device = new DeviceDetector(request()->userAgent());
$device->parse();
return $device;
});
});
Http::macro('whatsapp', function (): PendingRequest {
return Http::withToken(Config::get('whatsapp.authToken'))
->throw()
->baseUrl('https://graph.facebook.com/v20.0/')
->withOptions(['phoneId' => Config::get('whatsapp.phoneId')]);
});
}
}
No, not calling Json::withoutWrapping() anywhere
Okay, that all looks fine. 🤔
Are you able to give us access to the repository so we can take a look? Are you able to replicate the issue on a fresh Statamic install?
Could I send you my repository in private in .zip ? My project is not here in github, it's in my company private repository. I'll try to replicate it on a fresh install as soon as I can. Probably I'll not be able to replicate it. Didn't see anybody with the same issue . Just some extra information, I was doing the project on Statamic 4 and laravel 10. I updated everything mid project.
Sure. You can send it to support@statamic.com.
Hmm, strangly enough, even using the site you sent over, I'm not seeing any of the issues you pointed out.
Adding/editing fields in blueprints and fieldsets work as expected. Saving entries works as expected (the payload is valid JSON, unlike the screenshot you provided). The actions on the listing table are showing correctly.
I'm also not seeing any errors in my browser console or in the Laravel log file.
Do these issues happen locally for you, or only on production?
Bug description
Hi guys! I'm having some issues with the CP can someone help me? First error is happening on the blueprints. When I try to create new fields and edit the blueprint, i get some errors:
So I just close and open again multiple times, and click to save multiple times until it finally works.
Also I'm getting a lot of errors related to saving the field. When creating an Entry for example, I get the error "Couldn't save entry", but it ends up saving it, and when I try to save it again it says that it already exists.
Then, I decided to take a peak in the console and this was the JSON being sent in the request:
Is this JSON correct? It looks weird.
Some more console errors:
Tried to delete and got this:
Tried again:
It was deleted on the first try, althought presented error.
Also having a little bug when selecting entries to delete. The bar with options just looks like this:
Just some extra details:
-It's happening in more than one browser. Tested it on Edge and Chrome.
How to reproduce
I don't know if everyone is getting these errors, but to reproduce it just act normally, create blueprints, entrys, taxonomies, edit fields in blueprints, try to save entries and blueprints.
Logs
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response