Hi,
for some reason I can not save any changes on subpages of a specific parent page.
The error:
Missing argument 1 for Kirby\Panel\Models\Page::toggle(), called in /xxx/panel/app/src/panel/models/page/changes.php on line 71 and defined
I can save the subpages from other parent pages without any problems.
I have already reinstalled kirby (2.4.1) and regenerated all pages. Still the same error.
So what could be the problem here?
Could you please post the blueprint of the parent page?
Sure.
title: Akademie
pages:
template: Ausbildung
files: true
fields:
title:
label: Title
type: text
text:
label: Einleitungstext
type: textarea
header_image:
label: Titelbild
type: image
quotes:
label: Stimmen
type: structure
fields:
text:
label: Text
type: textarea
author:
label: Verfasser
type: textarea
Hm, that looks ok, what about the Ausbildung template?
Do you think the parent page is the problem?
Here is the template code:
<?php snippet('header') ?>
<main class="main theme-blue default-page training-detail" role="main">
<!-- SECTION WELCOME -->
<section class="page-header">
<div class="row row-padding">
<div class="large-12 column one-of-two-column">
<div class="headline-border-wrapper-h1">
<h1><?php echo $page->title()->html() ?></h1>
<div class="headline-border"></div>
</div>
</div>
<div class="large-6 medium-6 column one-of-two-column kirbytext">
<?php echo $page->text()->kirbytext() ?>
</div>
<div class="large-6 medium-6 column one-of-two-column kirbytext">
<table class="training-table">
<tr>
<td class="training-table-title">Art</td>
<td><?php echo $page->type(); ?></td>
</tr>
<!--
<tr>
<td class="training-table-title">Zeit</td>
<td><?php echo $page->date_from() . ' - ' . $page->date_to(); ?></td>
</tr>
-->
<tr>
<td class="training-table-title">Zielgruppe</td>
<td><?php echo $page->target(); ?></td>
</tr>
<tr>
<td class="training-table-title">Umfang</td>
<td><?php echo $page->duration(); ?></td>
</tr>
<tr>
<td class="training-table-title">Termine</td>
<td><?php echo $page->dates(); ?></td>
</tr>
<tr>
<td class="training-table-title">Leitung</td>
<td><?php echo $page->leader(); ?></td>
</tr>
</table>
</div>
</div>
</section>
<!-- SECTION CONTACT FORM -->
<section class="row row-padding">
<div class="large-12 column row-padding one-of-two-column">
<div class="headline-border-wrapper-h3">
<h3><?php echo l::get('join') ?></h3>
<div class="headline-border"></div>
</div>
</div>
<div class="form-wrapper">
<div class="large-6 medium-6 column row-padding one-of-two-column">
<?php if (strcmp($page->toggle(), 'false') !== 0) { ?>
<?php snippet('ausbildung_form'); ?>
<?php } else { ?>
<p>Anmeldungen zur Zeit nicht möglich.</p>
<?php } ?>
</div>
<div class="large-6 medium-6 column row-padding one-of-two-column">
<?php if (strcmp($page->comments(), '') !== 0) { ?>
<div class="form-item clearfix">
<div class="special-label">Anmerkungen/Kommentare</div>
</div>
<div class="training-comment">
<?php echo $page->comments()->kirbytext(); ?>
</div>
<?php } ?>
</div>
</div>
</section>
</main>
<?php snippet('footer') ?>
No, the template is irrelevant, it has nothing to do with the Panel. I meant the blueprint, sorry!
okay
This is the Ausbildung template:
title: Ausbildung
pages: false
files: true
fields:
title:
label: Title
type: text
order:
label: Reihenfolge (höchste Zahl oben)
type: number
excerpt:
label: Kurzfassung
type: textarea
text:
label: Text
type: textarea
type:
label: Art
type: text
type:
label: Art
type: text
target:
label: Zielgruppe
type: text
duration:
label: Dauer
type: text
dates:
label: Termine
type: text
leader:
label: Leitung
type: text
tags:
label: Schlagwörter (mit , trennen)
type: tags
lower: true
toggle:
label: Anmeldeformular aktivieren?
type: toggle
text: yes/no
comments:
label: Anmerkungen
type: textarea
I tested this and the problem seems to be the name of the toggle field, try to rename it to something else, maybe togglefield.
Also, you have two fields called type, rename one of them or delete, if that was created in error.
Ups, I think this could be the problem. Thank you!
I will try it tomorrow and tell you about the result.
lucask
June 7, 2017, 5:24pm
10
Thank you so much! Everything is working great now