Open mrkaluzny opened 3 years ago
Interesting - what does it output if you remove the {[ form:set }}
and {{ /form:set }]
tags?
Re-reviewing the documentation - I don't think both should be present there.
The output is the same. Also did you changed the format of comments? I'm trying to update an older project to latest v2 Statamic and Meerkat can't read comments that where saved
The comment format should not have changed - I will need to pull a fresh copy of the latest v2 Statamic and debug the form tag (realistic time lines put results for that sometime later this week).
There’s also an issue with fetching comments line 291 in ApiRoutes.PHP (trying to get property of null) I’ll add in the full error tomorrow. But with a broken form I can’t really see what’s the data structure is for comments.
@JohnathonKoster full log for comments fetching.
ErrorException: Trying to access array offset on value of type null
in /home/vagrant/Code/terzakis-new/site/addons/Meerkat/Routes/APIRoutes.php:291
Stack trace:
#0 /home/vagrant/Code/terzakis-new/site/addons/Meerkat/Routes/APIRoutes.php(291): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 [internal function]: Statamic\Addons\Meerkat\MeerkatController->Statamic\Addons\Meerkat\Routes\{closure}()
#2 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Support/Collection.php(469): array_map()
#3 /home/vagrant/Code/terzakis-new/site/addons/Meerkat/Routes/APIRoutes.php(293): Illuminate\Support\Collection->map()
#4 [internal function]: Statamic\Addons\Meerkat\MeerkatController->getApiComments()
#5 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Container/Container.php(507): call_user_func_array()
#6 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Container/Container.php(604): Illuminate\Container\Container->call()
#7 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Container/Container.php(502): Illuminate\Container\Container->callClass()
#8 /home/vagrant/Code/terzakis-new/statamic/core/Http/Controllers/StatamicController.php(124): Illuminate\Container\Container->call()
#9 /home/vagrant/Code/terzakis-new/statamic/core/Http/Controllers/StatamicController.php(93): Statamic\Http\Controllers\StatamicController->callControllerMethod()
#10 [internal function]: Statamic\Http\Controllers\StatamicController->controllerTrigger()
#11 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(256): call_user_func_array()
#12 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(164): Illuminate\Routing\Controller->callAction()
#13 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(112): Illuminate\Routing\ControllerDispatcher->call()
#14 [internal function]: Illuminate\Routing\ControllerDispatcher->Illuminate\Routing\{closure}()
#15 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(139): call_user_func()
#16 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#17 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): call_user_func()
#18 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(114): Illuminate\Pipeline\Pipeline->then()
#19 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(68): Illuminate\Routing\ControllerDispatcher->callWithinStack()
#20 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Routing/Route.php(203): Illuminate\Routing\ControllerDispatcher->dispatch()
#21 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Routing/Route.php(134): Illuminate\Routing\Route->runWithCustomDispatcher()
#22 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Routing/Router.php(708): Illuminate\Routing\Route->run()
#23 [internal function]: Illuminate\Routing\Router->Illuminate\Routing\{closure}()
#24 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(139): call_user_func()
#25 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#26 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): call_user_func()
#27 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Routing/Router.php(710): Illuminate\Pipeline\Pipeline->then()
#28 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Routing/Router.php(674): Illuminate\Routing\Router->runRouteWithinStack()
#29 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Routing/Router.php(635): Illuminate\Routing\Router->dispatchToRoute()
#30 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(236): Illuminate\Routing\Router->dispatch()
#31 [internal function]: Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}()
#32 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(139): call_user_func()
#33 /home/vagrant/Code/terzakis-new/site/addons/SeoPro/Middleware/GenerateReport.php(13): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#34 [internal function]: Statamic\Addons\SeoPro\Middleware\GenerateReport->handle()
#35 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array()
#36 /home/vagrant/Code/terzakis-new/statamic/core/Http/Middleware/TransformsRequest.php(31): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#37 [internal function]: Statamic\Http\Middleware\TransformsRequest->handle()
#38 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array()
#39 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#40 [internal function]: Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle()
#41 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array()
#42 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#43 [internal function]: Illuminate\View\Middleware\ShareErrorsFromSession->handle()
#44 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array()
#45 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(62): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#46 [internal function]: Illuminate\Session\Middleware\StartSession->handle()
#47 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array()
#48 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#49 [internal function]: Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle()
#50 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array()
#51 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(59): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#52 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies->handle()
#53 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array()
#54 /home/vagrant/Code/terzakis-new/statamic/core/StaticCaching/Middleware/Retrieve.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#55 [internal function]: Statamic\StaticCaching\Middleware\Retrieve->handle()
#56 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array()
#57 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(44): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#58 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle()
#59 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array()
#60 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#61 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): call_user_func()
#62 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(122): Illuminate\Pipeline\Pipeline->then()
#63 /home/vagrant/Code/terzakis-new/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(87): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
#64 /home/vagrant/Code/terzakis-new/index.php(167): Illuminate\Foundation\Http\Kernel->handle()
#65 {main}
@JohnathonKoster Have you had a chance to look into that issue?
@JohnathonKoster With APIRoutes.php there's an issue with in_response_to_url
Changing
$data['comment_count'] = collect($items)->where('in_response_to_url', $data['in_response_to_url'])->count();
to
if ($data) {
$data['comment_count'] = collect($items)->where('in_response_to_url', $data['in_response_to_url'])->count();
} else {
$data['comment_count'] = collect($items)->count();
}
That makes it work as expected
The tags issue is connected directly to formOpen() function.
I've managed to find the issue it's in Meerkat/MeerkatTags.php
line 96
Original
$this->parameters['attr'] = $this->parameters['attr'] . '|data-meerkat-form:comment-form';
Updated
$this->parameters['attr'] = $this->parameters['attr'] . 'data-meerkat-form:comment-form';
It seems like that |
caused to create an empty attr -> =""
breaking the form. Right now the form is working as expected.
Form tag is not being generated
Results in
Any ideas how to fix this?