thx @hube2 for the quick reply… unfortunately we did speed up our servers now and just hope to cover this issue for a longer time…
Hi,
I am not quite sure if this is the right topic but before opening a new thread I’d like to try it here first as it is somehow the same issue. Pls let me know if this would be worth a new topic…
My problem:
I use AFC very effective and pleased in the whole project. Since I created a new flip card group component I have the issue that editing the specific page creates an overload on RAM and CPU on my server. Viewing the page and clicking around in the admin console is fine. Only when I start editing and especially when I try to save my changes, the server looses connection to the database…
here is my layout:
<?php
namespace Flynt\Components\BnbCmsFlipCardGroup;
function getACFLayout()
{
return [
'name' => 'BnbCmsFlipCardGroup',
'label' => 'BNB CMS Flip Card Group',
'sub_fields' => [
[
'label' => __('Allgemeines', 'flynt'),
'name' => 'general',
'type' => 'tab',
],
[
'label' => __('Jumpmark', 'flynt'),
'name' => 'jumpmark',
'type' => 'text',
'instructions' => 'ACHTUNG: Jumpmarks MÜSSEN pro Seite einzigartig sein und dürfen KEINE Leerzeichen, Sonderzeichen oder Umlaute enthalten.<br>Doppelte Jumpmarks verringern die SEO Qualität und nur die erste Jumpmark wird angesprungen.',
],
[
'label' => 'Farbe (Hintergrund-Rahmen)',
'name' => 'color',
'type' => 'select',
'choices' => [
'black-black' => 'Standard Schwarz',
'yellow-red' => 'Gelb-Rot',
'red-yellow' => 'Rot-Gelb',
'green-red' => 'Grün-Rot',
'red-green' => 'Rot-Grün',
'yellow-purple' => 'Gelb-Lila',
'purple-yellow' => 'Lila-Gelb',
'green-purple' => 'Grün-Lila',
'purple-green' => 'Lila-Grün',
],
],
[
'label' => __('Headline', 'flynt'),
'name' => 'headline',
'type' => 'text',
],
[
'label' => __('Text', 'flynt'),
'name' => 'text',
'type' => 'wysiwyg',
'media_upload' => 0,
'delay' => 1,
],
[
'label' => __('Globaler Prefix Text Vorderseite', 'flynt'),
'name' => 'prefix',
'type' => 'text',
],
[
'label' => __('Flip Card Elemente', 'flynt'),
'name' => 'flip_card_items',
'type' => 'tab',
],
[
'label' => __('Flip Cards', 'flynt'),
'name' => 'flip_cards',
'type' => 'repeater',
'collapsed' => 'field_pageComponents_pageComponents_BnbCmsFlipCardGroup_flip_cards_text_front',
'layout' => 'row',
'min' => 1,
'button_label' => 'Hinzufügen',
'sub_fields' => [
[
'label' => __('Text', 'flynt'),
'name' => 'text_settings',
'type' => 'tab',
],
[
'label' => __('Text Vorderseite', 'flynt'),
'name' => 'text_front',
'type' => 'text',
],
[
'label' => __('Text Rückseite', 'flynt'),
'name' => 'text_back',
'type' => 'wysiwyg',
'media_upload' => 0,
'delay' => 1,
],
[
'label' => __('Bild', 'flynt'),
'name' => 'image_setting',
'type' => 'tab',
],
[
'label' => 'Image',
'name' => 'image',
'type' => 'image',
'return_format' => 'id',
'preview_size' => 'medium',
],
[
'label' => 'Bildrechte',
'name' => 'image_copyright',
'type' => 'text',
'instructions' => 'Überschreibt die Daten aus dem Feld "Beschreibung" der Mediathek.<br>NOTIZ: KEINE Zeilenumbrüche. Anführungszeichen müssen einen vorhergehenden Backslash haben (z.B. \"Lorem Ipsum\").',
],
[
'label' => 'Bild Alt-Text',
'name' => 'image_alt',
'instructions' => 'Überschreibt die Daten aus dem Feld "Alternativer Text" der Mediathek. Wird nur gesetzt, sollte keine Bildunterschrift gesetzt werden!<br>NOTIZ: KEINE Zeilenumbrüche. Anführungszeichen müssen einen vorhergehenden Backslash haben (z.B. \"Lorem Ipsum\").',
'type' => 'text',
],
[
'label' => 'Bild Helligkeit',
'name' => 'image_mode',
'type' => 'radio',
'choices' => [
'false' => 'Dark copyright',
'true' => 'Bright copyright',
],
],
[
'label' => 'Bild Abdeckung',
'name' => 'image_coverage',
'type' => 'radio',
'instructions' => '
Cover: Der ersetzte Inhalt wird in der Größe angepasst, sodass das Seitenverhältnis beibehalten wird während die gesamte Inhaltsbox des Elements ausgefüllt wird: die konkrete Objektgröße wird als eine Abdeckbeschränkung auf die verwendete Breite und Höhe des Elements bestimmt.
<br>
<br>
Contain: Der ersetzte Inhalt wird in der Größe angepasst, sodass das Seitenverhältnis beibehalten wird während es an die Inhaltsbox des Elements angepasst wird: die konkrete Objektgröße wird als eine Inhaltsbeschränkung auf die verwendete Breite und Höhe des Elements bestimmt.
',
'choices' => [
'cover' => 'Cover',
'contain' => 'Contain Whole Image',
],
],
[
'label' => 'Bild Position',
'name' => 'image_position',
'type' => 'group',
'sub_fields' => [
[
'label' => 'Bild Position Wert #1',
'name' => 'image_position_value1',
'type' => 'radio',
'choices' => [
'top' => 'top',
'bottom' => 'bottom',
'left' => 'left',
'right' => 'Right',
'center' => 'Center',
],
'layout' => 'horizontal',
],
[
'label' => 'Bild Position Wert #2',
'name' => 'image_position_value2',
'type' => 'radio',
'choices' => [
'top' => 'top',
'bottom' => 'bottom',
'left' => 'left',
'right' => 'Right',
'center' => 'Center',
],
'layout' => 'horizontal',
],
[
'label' => 'Prozentwerte',
'name' => 'percentage',
'type' => 'text',
'instructions' => '
Insert 1-2 values as
<br>
A) Prozentwerte <b>z.B. 50% 20%</b> für die horizontale und vertikale Achse
<br>
<b>OR</b>
<br>
B) Pixel <b>z.B. 100px 20px</b> für eine pixelgenaue Position
',
],
],
],
],
],
],
];
}
As a hotfix we where able to solve it by increasing the RAM and CPU on the server but I am afraid that this will pop up again as we did not even have the full content on our staging system so far.
Any ideas why? As we will have to go live with the feature pretty soon, I am a bit concerned I missed something in the structure to prevent this issue…
thx in advance.
@hube2 I received an answer in the flynt Q&A on github.
maybe this helps someone else or you can add it in the docu.
This is the error code:
Fatal error: Uncaught Exception: Field config must not contain a 'key' property. in /mnt/web509/e2/11/57106911/htdocs/my-wp-folder/wp-content/themes/my-theme/vendor/flyntwp/acf-field-group-composer/lib/ACFComposer/ResolveConfig.php:188 Stack trace: #0 /mnt/web509/e2/11/57106911/htdocs/my-wp-folder/wp-content/themes/my-theme/vendor/flyntwp/acf-field-group-composer/lib/ACFComposer/ResolveConfig.php(111): ACFComposer\ResolveConfig::validateConfig() #1 /mnt/web509/e2/11/57106911/htdocs/my-wp-folder/wp-content/themes/my-theme/vendor/flyntwp/acf-field-group-composer/lib/ACFComposer/ResolveConfig.php(52): ACFComposer\ResolveConfig::forEntity() #2 /mnt/web509/e2/11/57106911/htdocs/my-wp-folder/wp-content/themes/my-theme/vendor/flyntwp/acf-field-group-composer/lib/ACFComposer/ResolveConfig.php(140): ACFComposer\ResolveConfig::forField() #3 [internal function]: ACFComposer\ResolveConfig::ACFComposer\{closure}() #4 /mnt/web509/e2/11/57106911/htdocs/my-wp-folder/wp-con in /mnt/web509/e2/11/57106911/htdocs/my-wp-folder/wp-content/themes/my-theme/vendor/flyntwp/acf-field-group-composer/lib/ACFComposer/ResolveConfig.php on line 188
AFAIK its not allowed to have name
AND key
at the same time. Unfortunately I need the name or my twig template.
any suggestions?
@hube2 thx for you quick reply…
As the flynt theme is using 'name'
instead of 'key'
and its throwing an error if I use 'key'
… any chance to get the collapse work without the 'key'
?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.