Closed cgundermann closed 4 years ago
Hey @CrisGraphics, thank you so much for bringing is up 🤯
I can confirm this issue and need to have a deeper look. The changelog states a bunch of kirby refactorings so it probably relates to that. Not sure what is going on...
Wish I could help You, but I (still) have absolutely no Vue skills, even though the issue seems to be php related...
I appreciate that but no worries! I already found the root cause but I’m still not sure why it breaks something totally unrelated 😑
I’m going to fix some of the other issues and provide a release soon.
@CrisGraphics This issue has now been fixed.
Sadly I'm not able to explain why this occurred at all. I'll try to shed some light by opening a bug ticket at kirby core. It seems wired to me, that something totally unrelated broke.
I'll keep you updated here...
Hey, many thanks for looking into it, I really appreciate it. Sadly it still doesn't work with kirby v3.4.0-rc2 (tried both installations, via composer and manually).
This is, what I get, when I want to install the panel:
And this, when a user already exists:
When I remove Your plugin from the plugins folder, everything works fine. Not sure, what I'm missing here 🤔
@CrisGraphics Dang! Sorry for that... 🙊 Unfortunately I'm no longer able to reproduce this. Maybe it's a dumb question but have you tried to clear the browser cache?
It would be awesome if you could provide an example.
Hm, that's weird,... Here's how I installed it:
Terminal:
Installed the starterkit (as described here):
composer create-project getkirby/starterkit starterkit
then updated the require section of the composer.json
to this:
"require": {
"php": ">=7.1.0",
"getkirby/cms": "dev-release/3.4.0",
"gearsdigital/enhanced-toolbar-link-dialog": "^1.3"
},
and then just hit
composer update
- Updating laminas/laminas-escaper (2.6.0 => 2.6.1): Downloading (100%)
- Updating filp/whoops (2.3.1 => 2.7.2): Downloading (100%)
- Updating phpmailer/phpmailer (v6.0.7 => v6.1.6): Downloading (100%)
- Updating claviska/simpleimage (3.3.3 => 3.3.4): Downloading (100%)
- Updating mustangostang/spyc (0.6.2 => 0.6.3): Downloading (100%)
- Removing getkirby/cms (3.3.6)
- Installing getkirby/cms (dev-release/3.4.0 9fa1114): Cloning 9fa111493c from cache
- Installing gearsdigital/enhanced-toolbar-link-dialog (v1.3.1): Downloading (100%)
Cleared the browser cache and also tried it in another browser.
But,... no worries... I'll stick to kirby 3.3.6 for this project and give it another try, as soon as the stable version has been released :) A trillion thanks again!
I experience kind of similar issue after updating Kirby to 3.4.0 and Enhanced Toolbar Link Dialog to 1.3.1. When I open the panel, I get the error: Undefined index: type
Edit: Version 1.2.3 of the plugin seems to work fine.
Thank you very much @janherman for reporting this issue. I’ll have a look an try to investigate what is going on…
@janherman @CrisGraphics I reseted my kirby development environenment completely, installed a fresh starterkit and a the latest version of Enhanced Toolbar Link Dialog (which is namly 1.3.1) via composer and for gods sake I've no issues :(
Could you please try to manually remove Enhanced Toolbar Link Dialog from your plugins directory and then have it reinstalled?
Otherwise I would ask you to provide some details about your setup? Maybe it's a conflict somewhere else.
Thanks in advance.
I think the issue is not related to other plugins. At least in my case. I tried fresh Kirby Starterkit, updated Kirby to 3.4.0 and installed the latest version of Enhanced Toolbar Link Dialog (1.3.1). Still get the same error.
I tested in latest Firefox and Chrome and I use Xampp with PHP 7.4.1 for development.
Thanks @janherman! Maybe this relates to PHP itself. You're using7.4.1
while I'm on 7.2.2
. Would you mind to provide the php log?
@CrisGraphics Which PHP Version are you running?
@janherman @CrisGraphics Could you please try to remove 'type'=> null,
from site/plugins/enhanced-toolbar-link-dialog/index.php:11
manually and tell me if that solves the issue?
Thanks for your suggestion, @gearsdigital. I removed the line but it did not solve the issue. I even do not get to the login screen, the error message appears as soon as I try to access panel/login page (I was able to login before, the error message showed right after I logged in).
By PHP log you mean something like phpinfo() output or anything else?
@gearsdigital Sorry for the late reply,
as @janherman mentioned, the error persists by removing the line. If I give the type some value, I can at least fill in the login form but after hitting login, the same error shows up again: undefined index type
.
I'm also running php 7.4
I mean... WTF?
@janherman Just the php-error.log. You can lookup the location using <?php phpinfo(); ?>
.
@CrisGraphics No worries. I'm glad you both are helping me out here :)
Unfotunately there's still no docs for custom models... Will try and look through Your code, maybe I'll find sth... 🙌🏼
@gearsdigital Ok, I found it and there are no errors at all. :shrug:
Thanks for your effort!
@janherman, @gearsdigital
So, I don't know why, but I think I got it 😊
You also have to declare a type for the simplepagecollection
:
'collections' => [
'simplepagecollection' => [
'type'=> null,
'model' => 'simplepagemodel',
],
],
Edit : This works for me (kirby 3.4.0, enhanced-toolbar-link-dialog 1.3.1, php7.4) Just don't know how to make pull requests... I'm not very familiar with GitHub yet.
On step by the time. I'm now able tp reproduce this issue by adding error_reporting(E_ALL);
to the top of the index.php. Now I only need to understand how custom models are really working.
@CrisGraphics I tried that biut it didn't work. I got it working by additionally adding 'type'=> null
to the models section.
Kirby::plugin('gearsdigital/enhanced-toolbar-link-dialog', [
'api' => [
'models' => [
// a camelCased model name results in Kirby\Exception\NotFoundException
'simplepagemodel' => [
++ 'type'=> null,
'fields' => [
'id' => function ($page) {
return $page->id();
},
'title' => function ($page) {
$query = option('gearsdigital.enhanced-toolbar-link-dialog.link.title', '{{ page.title }}');
return Str::template($query, [
'page' => $page,
'site' => site(),
'kirby' => kirby(),
]);
},
'slug' => function ($page) {
return URL::makeAbsolute($page->parent().DS.$page->slug());
},
],
],
],
'collections' => [
'simplepagecollection' => [
++ 'type'=> null,
'model' => 'simplepagemodel',
],
],
'routes' => [
[
'pattern' => 'enhanced-toolbar-link-dialog/pages',
'method' => 'get',
'action' => function () {
$page = get('page');
$query = get('search');
if (empty($query)) {
$query = '*';
}
$pagedCollection = site()->search($query, 'title')->paginate([
'page' => $page,
'limit' => 10,
]);
return $this->collection('simplepagecollection', $pagedCollection);
},
],
],
],
'translations' => [
'en' => [
'gearsdigital.enhanced-toolbar-link-dialog.internal' => 'Internal Link',
'gearsdigital.enhanced-toolbar-link-dialog.external' => 'External Link',
'gearsdigital.enhanced-toolbar-link-dialog.empty' => 'No pages found',
'gearsdigital.enhanced-toolbar-link-dialog.target.title' => 'Link Target',
'gearsdigital.enhanced-toolbar-link-dialog.target.help' => 'Specify where to open the linked document.'
],
'de' => [
'gearsdigital.enhanced-toolbar-link-dialog.internal' => 'Interner Link',
'gearsdigital.enhanced-toolbar-link-dialog.external' => 'Externer Link',
'gearsdigital.enhanced-toolbar-link-dialog.empty' => 'Keine Seiten gefunden.',
'gearsdigital.enhanced-toolbar-link-dialog.target.title' => 'Link Ziel',
'gearsdigital.enhanced-toolbar-link-dialog.target.help' => 'Gibt an, wo das verknüpfte Dokument geöffnet werden soll.',
],
],
]);
Could you check that for me? Using ´error_reporting(E_ALL);´ no error is shown.
Yes, that's exactly what I wrote above =) Works fine now with type declarations for both, the model and the collection.
My bad 🙈
I'ld love to have you as contributer here! https://opensource.com/article/19/7/create-pull-request-github
@janherman Can you verify the solution works for you?
Thanks for the Tutorial Page (*embarrassed). I'll check it out in a minute 😀
Yes, I can confirm this solution works with my setup. 👍
Sorry, I didn't mean to embarrass you @CrisGraphics! I assumed that you're not familiar with making pull requests... If you have any questions please let me know. I'll guide you through the process if you want to. Just want to make sure you get the credits here :)
@janherman Awesome! Thanks for checking out.
I'll provide a fix as soon as @CrisGraphics made the PR (No pressure @CrisGraphics. Take your time! ☺️ )
I assumed that you're not familiar with making pull requests...
You were assuming right, haha. Ok, I tried to make a pull request. Hope I didn't blow up GitHub or the Internet now...
How awesome :)
Thank you very much @janherman and @CrisGraphics! As this issue seems to be resolved now I'm going to close it :)
Describe the bug
Unfortunately Your plugin breaks the panel of the recent kirby version.
To Reproduce
Case 1:
Console output:
Case 2:
Console output:
*enhanced-toolbar-link-dialog Version
1.2.3
Kirby Version
3.4.0-rc.2
Additional context
Many thanks in advance for having a look into it! 🙌🏼 😊