Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WP-CLI Error : Segmentation fault #179

Open
grzesiek1owline opened this issue Oct 26, 2023 · 1 comment
Open

WP-CLI Error : Segmentation fault #179

grzesiek1owline opened this issue Oct 26, 2023 · 1 comment

Comments

@grzesiek1owline
Copy link

I find some problem with specific ACF Fields structure.
I use ACF Flex Builder and when i created structure like this:

<?php

namespace App\Fields;

use App\Fields\Partials\PageBuilder;
use Log1x\AcfComposer\Field;
use StoutLogic\AcfBuilder\FieldsBuilder;

class CarrersPage extends Field
{
    /**
     * The field group.
     *
     * @return array
     */
    public function fields()
    {
        $carrerspage = new FieldsBuilder('carrerspage', ['title' => 'Oferty pracy']);

        $carrerspage
            ->setLocation('page_template', '==', 'template-carrer.blade.php')
            ->setGroupConfig('hide_on_screen', [ 'the_content', 'block_editor' ]);

        $carrerspage
            ->addTab('content', ['label' => 'Zawartość strony'])
            ->addTab('builder-tab', ['label' => 'Struktura strony'])
                ->addFields($this->get(PageBuilder::class))
        ;

        return $carrerspage->build();
    }
}
<?php

namespace App\Fields\Partials;

use Log1x\AcfComposer\Partial;
use StoutLogic\AcfBuilder\FieldsBuilder;

class PageBuilder extends Partial {
  /**
   * The partial field group.
   *
   * @return \StoutLogic\AcfBuilder\FieldsBuilder
   */
  public function fields() {
    $pageBuilder = new FieldsBuilder( 'page_builder' );

    $pageBuilder
      ->addFlexibleContent( 'builder', [ 'label' => 'Sekcje strony', 'button_label' => 'Dodaj sekcje' ] )
      ->addLayout( $this->get( IconList::class ) )
      ->endFlexibleContent();

    return $pageBuilder;
  }
}
<?php

namespace App\Fields\Partials;

use Log1x\AcfComposer\Partial;
use StoutLogic\AcfBuilder\FieldsBuilder;

class IconList extends Partial {
  /**
   * The partial field group.
   *
   * @return \StoutLogic\AcfBuilder\FieldsBuilder
   */
  public function fields() {
    $iconList = new FieldsBuilder( 'icon_list', [ 'label' => 'Lista ikon' ] );

    $iconList
      ->addGroup( 'icon_list', [ 'label' => 'Lista ikon' ] )
          ->addSelect( 'bg-color', [ 'label'         => 'Kolor tła',
                                     'choices'       => [ 'bg-white' => 'Biały', 'bg-light-300' => 'Szary' ],
                                     'default_value' => 'white'
          ] )
          ->addWysiwyg( 'title', [ 'label'        => 'Tytuł',
                                   'required'     => 1,
                                   'media_upload' => 0,
                                   'delay'        => 1,
                                   'tabs'         => 'all',
                                   'wrapper'      => [ 'width' => '50' ]
          ] )
          ->addRepeater( 'list', [ 'label' => 'Lista ikon', 'button_label' => 'Dodaj ikonę', 'layout' => 'row' ] )
              ->addImage( 'icon', [ 'label'         => 'Ikona',
                                    'return_format' => 'id',
                                    'preview_size'  => 'thumbnail',
                                    'library'       => 'all',
                                    'mime_types'    => 'svg'
              ] )
              ->addText( 'text', [ 'label' => 'Tekst' ] )
          ->endRepeater()
      ->endGroup();

    return $iconList;
  }
}

I cant use wp-cli, because i have segmentation error or blank response.
If i remove SELECT FIELD from GROUP in Icon List - wp-cli works fine.

Often i have this problem when i have Select Field in Group.

I have the same problem when i have php error, like no ';' on end of file.

OS:
MacOs Catalina
Ubuntu 21

PHP
8.0
8.1

@stevep
Copy link
Member

stevep commented Oct 26, 2023

I'm not sure I can help much, but does appending --debug to the wp cli call help provide any useful error messages?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants