Can't use InlineCreate - array_filter() expects parameter 1 to be array, null given

Hi,
I wanna use the InlineCreate operation and do some things on create and update methods.
When I have the request as argument :
public function store(StoreRequest $request){ ... }
I have this error :
Too few arguments to function App\\Http\\Controllers\\Admin\\OrderItemCrudController::store(), 0 passed
And when I remove request from argument, and use this in the method :
$this->crud->request->request->get('...')
I have this error :
Cannot access protected property Backpack\\CRUD\\app\\Library\\CrudPanel\\CrudPanel::$request
Is there a way to get the request with the InlineCreate operation ?
Thanks for your help,

Ok my bad ! I see now we have to use :
$this->crud->getRequest()
So it's okay, sorry !

Still have a problem with the InlineCreate operation :
{message: "array_filter() expects parameter 1 to be array, null given", exception: "ErrorException",…} exception: "ErrorException" file: "/Users/kevinrignault/Documents/PROJECTS/bluto.local/vendor/backpack/crud/src/app/Library/CrudPanel/Traits/SaveActions.php" line: 51 message: "array_filter() expects parameter 1 to be array, null given" trace: [{function: "handleError", class: "Illuminate\Foundation\Bootstrap\HandleExceptions", type: "->"},…]
I have this error when I save from the modal ! Something about the save action ?
Thanks

It should work just fine with 1-n relationships, yes. But from what I see - your problem is with SaveActions.php which is weird because afaik we're not using SaveActions inside the InlineCreate modal. @pxpm what do you think might be the problem?

Hum ... I don't think it's possible for them to relate.
We just call create() that has nothing with save actions on it.

If this stills a bug please re-open. I really don't think this is reproducible.

Hey there, I'm having the exact same issue.  array_filter() expects parameter 1 to be array, null given {"exception":"[object] (ErrorException(code: 0): array_filter() expects parameter 1 to be array, null given at /var/www/local.at20skladiste/vendor/backpack/crud/src/app/Library/CrudPanel/Traits/SaveActions.php:51) Any news on this??

I'm just commenting to say that I am having the same issue with n-n inline create

hello @zachweix could you provide me the output of php artisan backpack:version and also the full stack or atleast the previous error in stack ? I mean, you get the array_filter error but there is somethings that previously calls: getSaveActionByOrder(). Can you provide me more error detail ?
I am going to re-open this as so many have the same error, I just could not reproduce it.
It's something I am doing wrong or something is missing.
By any chance you are removing/manipulating the save actions in the crud you create inline or in the main crud?
The error is triggered because $this->getOperationSetting('save_actions') is not returning an array even if empty, is returning null.
We setup 3 save actions by default, even if we don't use it in the inline modal (we just use save and cancel), when we get the inline modal we build a full CrudPanel for the inlined crud.
I can't think when will $this->getOperationSetting('save_actions') be null. Event when you$this->crud->removeAllSaveActions() we set it up as an empty array.
    public function removeAllSaveActions()
    {
        $this->setOperationSetting('save_actions', []);
    }

We use inline create in demo for example, and it works. That's why something must be different.
Thanks for understanding and sorry for this bad experience.
Best,
Pedro

[2020-09-01 19:31:38] local.ERROR: array_filter() expects parameter 1 to be array, null given {"userId":97303,"exception":"[object] (ErrorException(code: 0): array_filter() expects parameter 1 to be array, null given at /home/vagrant/code/healthmeans-laravel/vendor/backpack/crud/src/app/Library/CrudPanel/Traits/SaveActions.php:51)
[stacktrace]
#0 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(2, 'array_filter() ...', '/home/vagrant/c...', 51, Array)
#1 /home/vagrant/code/healthmeans-laravel/vendor/backpack/crud/src/app/Library/CrudPanel/Traits/SaveActions.php(51): array_filter(NULL, Object(Closure))
#2 /home/vagrant/code/healthmeans-laravel/vendor/backpack/crud/src/app/Library/CrudPanel/Traits/SaveActions.php(28): Backpack\\CRUD\\app\\Library\\CrudPanel\\CrudPanel->getSaveActionByOrder(1)
#3 /home/vagrant/code/healthmeans-laravel/vendor/backpack/crud/src/app/Library/CrudPanel/Traits/SaveActions.php(307): Backpack\\CRUD\\app\\Library\\CrudPanel\\CrudPanel->getFallBackSaveAction()
#4 /home/vagrant/code/healthmeans-laravel/vendor/backpack/crud/src/app/Http/Controllers/Operations/CreateOperation.php(86): Backpack\\CRUD\\app\\Library\\CrudPanel\\CrudPanel->setSaveAction()
#5 /home/vagrant/code/healthmeans-laravel/vendor/backpack/crud/src/app/Http/Controllers/Operations/InlineCreateOperation.php(78): App\\Http\\Controllers\\Admin\\ContentTagCrudController->store()
#6 [internal function]: App\\Http\\Controllers\\Admin\\ContentTagCrudController->storeInlineCreate()
#7 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array(Array, Array)
#8 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction('storeInlineCrea...', Array)
#9 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Routing/Route.php(219): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(App\\Http\\Controllers\\Admin\\ContentTagCrudController), 'storeInlineCrea...')
#10 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Routing/Route.php(176): Illuminate\\Routing\\Route->runController()
#11 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Routing/Router.php(681): Illuminate\\Routing\\Route->run()
#12 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#13 /home/vagrant/code/healthmeans-laravel/vendor/backpack/crud/src/app/Http/Controllers/CrudController.php(43): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#14 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(153): Backpack\\CRUD\\app\\Http\\Controllers\\CrudController->Backpack\\CRUD\\app\\Http\\Controllers\\{closure}(Object(Illuminate\\Http\\Request), Object(Closure))
#15 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#16 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#17 /home/vagrant/code/healthmeans-laravel/app/Http/Middleware/CheckIfAdmin.php(63): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#18 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): App\\Http\\Middleware\\CheckIfAdmin->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#19 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#20 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#21 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(76): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#22 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#23 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#24 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#25 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(56): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#26 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#27 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#28 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#29 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(66): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#30 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#31 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#32 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Routing/Router.php(683): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#33 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Routing/Router.php(658): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))
#34 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Routing/Router.php(624): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))
#35 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Routing/Router.php(613): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))
#36 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(170): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))
#37 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))
#38 /home/vagrant/code/healthmeans-laravel/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(65): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#39 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Barryvdh\\Debugbar\\Middleware\\InjectDebugbar->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#40 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#41 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#42 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#43 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#44 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#45 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#46 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(63): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#47 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#48 /home/vagrant/code/healthmeans-laravel/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#49 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Fideloper\\Proxy\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#50 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#51 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(145): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#52 /home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#53 /home/vagrant/code/healthmeans-laravel/public/index.php(55): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#54 {main}
"}

This is the Main Crud Controller that has the relationship field in it.
crud->setModel(\App\Models\Group::class);
        $this->crud->setRoute(config('backpack.base.route_prefix').'/group');
        $this->crud->setEntityNameStrings('group', 'groups');

        $this->crud->orderBy('title');
        $this->crud->operation(['create', 'update'], function () {
            $this->setupFields();
        });

        // a trait used across CRUD controllers to disable features based on a user's permissions
        $this->updateAccessControls();
    }

    public function fetchTags()
    {
        return $this->fetch(\App\Models\ContentTag::class);
    }

    protected function setupListOperation()
    {
        $this->crud->setDefaultPageLength(100);

        $this->crud->addFilter([
            'type' => 'simple',
            'name' => 'premium_content',
            'label'=> 'Available for Purchase',
        ],
            false,
            function () { // if the filter is active
                $this->crud->addClause('where', 'premium_content', '=', true);
            });

        $this->crud->addColumns([
            'title',
            [
                'name' => 'Available for Purchase',
                'type' => 'closure',
                'function' => function ($entry) {
                    if ($entry->premium_content) {
                        return '';
                    } else {
                        return '';
                    }
                },
            ],
        ]);
    }

    public function store()
    {
        $this->crud->setValidation(GroupRequest::class);
        $response = $this->traitStore();

        $id = $this->crud->entry->id;
        $data = UtilityService::getShortURLS('https://healthmeans.com/group/', $id);
        $this->crud->entry->short_url = $data->shorturl;
        $this->crud->entry->save();
        UtilityService::clearCache();

        return $response;
    }

    public function update()
    {

        if (!backpack_user()->isGivenPermissionTo('update')) {
            return abort(403);
        }

        //$this->crud->setValidation(GroupRequest::class);

        $request = $this->crud->getRequest();
        //$id = \Route::current()->parameter('id');
        /*
        if($request['short_url'] == '' || $request['short_url'] == null){
           /// LINE TAKEN OUT ///
            $request['short_url'] = $data->shorturl;
        }
        */
        $response = $this->traitUpdate();
        UtilityService::clearCache();
        return $response;
    }

    public function setupFields()
    {
        $tab1 = 'General Info';
        $tab2 = 'Talks';
        $tab3 = 'Access';
        $tab4 = 'Content Providers';

        $default_group_cost = SiteSetting::where('key', 'global_cost_of_group')->first();

        $this->crud->addField(
            [
                'name' => 'cover_photo_url',
                'label' => 'Cover Photo',
                'type' => 'image',
                'upload' => true,
                'tab' => $tab1,
                'disk' => 's3',
            ]
        );

        $this->crud->addField(
            [
                'name' => 'background_photo_url',
                'label' => 'Background Photo',
                'type' => 'image',
                'upload' => true,
                'tab' => $tab1,
                'disk' => 's3',
            ]
        );

        $this->crud->addField([
            'name' => 'legacy_id',
            'type' => 'text',
            'attributes' => ['disabled' => 'disabled'],
            'tab' => $tab1,
            'wrapper' => [
                'class' => 'form-group col-lg-6',
            ],
        ]);

        $this->crud->addField([
            'name' => 'title',
            'tab' => $tab1,
            'wrapper' => [
                'class' => 'form-group col-lg-6',
            ],
        ]);

        $this->crud->addField([
            'name' => 'short_url',
            'attributes' => ['disabled' => 'disabled'],
            'tab' => $tab1,
            'wrapper' => [
                'class' => 'form-group col-lg-6',
            ],
        ]);

        $this->crud->addField([
            'name' => 'description',
            'type' => 'ckeditor',
            'tab' => $tab1,
        ]);

        $this->crud->addField([
            'name' => 'short_description',
            'type' => 'ckeditor',
            'maxCharCount' => 200,
            'tab' => $tab1,
        ]);

        $this->crud->addField([
            'name' => 'advert_id',
            'label' => 'Advertisment ID',
            'tab' => $tab1,
        ]);
        $this->crud->addField(
            [
                'label'     => 'Content Tags',
                'name'      => 'content_tags',
                'type' => "relationship",
                'model' => "App\Models\ContentTag",
                'ajax' => true,
                'attribute' => 'label',
                'entity' => 'content_tags',
                'inline_create' => [ 'entity' => 'content_tag'],
                'tab'       => $tab1,
                'data_source' => url("admin/group/fetch/tags"),
            ],

        );

        $this->crud->addField([
            'name' => 'affiliate_id',
            'tab' => $tab1,
        ]);

        $this->crud->addField([
            'name' => 'hide_speakers',
            'label' => 'Hide Content Providers',
            'type' => 'checkbox',
            'tab' => $tab1,
        ]);

        $this->crud->addField([
            'name' => 'hide_media_attachments',
            'label' => 'Hide Downloadable Content (Pdfs, etc.)',
            'type' => 'checkbox',
            'tab' => $tab1,
        ]);

        $this->crud->addField([
            'name' => 'hide_auto_generated',
            'label' => 'Hide Auto-Generated Content? (Audio/Video)',
            'type' => 'checkbox',
            'tab' => $tab1,
        ]);

        //TALKS TAB FIELDS
        $this->crud->addField([
            'name' => 'talk list',
            'title' => 'Talks',
            'type' => 'talk_list',
            'api_url' => '/admin/api/group/'.\Route::current()->parameter('id').'/talks',
            'tab' => $tab2,
        ]);

        $this->crud->addField(
            [
                'name' => 'premium_content',
                'label' => 'Available for Purchase',
                'type' => 'checkbox',
                'tab' => $tab3,
                'wrapper' => [
                    'style' => 'margin-bottom:0px;',
                ],
            ]
        );

        $this->crud->addField(
            [
                'name' => 'premium_cost',
                'label' => '',
                'hint' => 'If no cost is entered and Available for Purchase is checked the default cost of $'.$default_group_cost->value.' will be used.',
                'type' => 'number',
                'attributes' => ['step' => '0.01', 'placeholder'=> $default_group_cost->value],
                'wrapper' => [
                    'class' => 'no-label form-group col-sm-12',
                    'style' => 'margin-bottom:0px;',
                ],
                'tab' => $tab3,
            ]
        );

        $this->crud->addField([
            'name' => 'separator_two',
            'type'=>'custom_html',
            'value' => '',
            'tab' => $tab3,
            'wrapper' => [
                'style' => 'margin-bottom:0px;',
            ],
        ]);

        $this->crud->addField(
            [
                'name' => 'premium_live_date',
                'label' => 'Visibility Date',
                'type' => 'date_picker',
                'tab' => $tab3,
                'hint' => 'This field sets when a group will be visible to end-users. NOTE: This does not apply to users with a Pro Membership.',
                'date_picker_options' => [
                    'format' => 'mm/dd/yyyy',
                    'language' => 'en',
                ],
                'wrapper' => [
                    'style' => 'margin-bottom:0px;',
                ],
            ]
        );

        $this->crud->addField(
          [
              'name' => 'speaker_list',
              'type' => 'view',
              'view' => 'speakerList',
              'tab' => $tab4,
          ]
        );

        // add asterisk for fields that are required in GroupRequest
        $this->crud->setRequiredFields(GroupRequest::class, 'create');
        $this->crud->setRequiredFields(GroupRequest::class, 'edit');
    }
}

This is the controller for the item I'm trying to create inline.
<?php

namespace App\Http\Controllers\Admin;

use Backpack\CRUD\app\Http\Controllers\CrudController;
use App\Http\Requests\ContentTagCrudRequest;

class ContentTagCrudController extends CrudController
{
    use \Backpack\CRUD\app\Http\Controllers\Operations\InlineCreateOperation;

    use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation;
    use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
    use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
    use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
    use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;

    public function setup()
    {
        $this->crud->setModel("App\Models\ContentTag");
        $this->crud->setRoute(config('backpack.base.route_prefix').'/content_tag');
        $this->crud->setEntityNameStrings('content tag', 'content tags');
    }

    public function setupListOperation()
    {
        $this->crud->setColumns(['label']);
    }

    public function setupCreateOperation()
    {

        $this->crud->setValidation(ContentTagCrudRequest::class);

        $this->crud->addField([
          'name' => 'label',
          'type' => 'text',
          'label' => "Label"
        ]);
    }

    public function setupUpdateOperation()
    {
        $this->setupCreateOperation();
    }
}

The content tag that I am trying to create gets created successfully. It just doesn't send it down to the relationship field and / or update the parent model I'm trying to attach the tag to.

Any kind of update on this?? This is a pretty necessary feature.

I'm using this in another controller now and per the comment by @pxpm I'm not using custom names for the controllers. I'm still seeing the same problem.
<?php

namespace App\Http\Controllers\Admin;

use App\Http\Requests\HTOOfferSegmentRequest;
use Backpack\CRUD\app\Http\Controllers\CrudController;
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;
use App\Http\Traits\AccessControl;

/**
 * Class HTOOfferSegmentCrudController
 * @package App\Http\Controllers\Admin
 * @property-read \Backpack\CRUD\app\Library\CrudPanel\CrudPanel $crud
 */
class HTOSegmentCrudController extends CrudController
{
    use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation;
    use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
    use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
    use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
    use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
    use \Backpack\CRUD\app\Http\Controllers\Operations\FetchOperation;
    use AccessControl;

    public function setup()
    {
        $this->crud->setModel('App\Models\HTOSegment');
        $this->crud->setRoute(config('backpack.base.route_prefix') . '/hto/segment');
        $this->crud->setEntityNameStrings('Segment', 'Segments');
        $this->crud->operation(['create', 'update'], function () {
            $this->setupFields();
        });

        // a trait used across CRUD controllers to disable features based on a user's permissions
        $this->updateAccessControls();
    }

    public function fetchTags()
    {
        return $this->fetch(\App\Models\ContentTag::class);
    }

    protected function setupListOperation()
    {
        // TODO: remove setFromDb() and manually define Columns, maybe Filters
        $this->crud->addColumns(['name']);
    }

    protected function setupFields()
    {

        // TODO: remove setFromDb() and manually define Fields
        $this->crud->addField([
            'label' => 'Name',
            'name' => 'name'
        ]);

        $this->crud->addField(
            [
                'label'     => 'Content Tags',
                'name'      => 'content_tags',
                'type' => "relationship",
                'model' => "App\Models\ContentTag",
                'ajax' => true,
                'attribute' => 'label',
                'entity' => 'content_tags',
                'inline_create' => [ 'entity' => 'content_tag'],
                'data_source' => url("admin/hto/segment/fetch/tags"),
            ],

        );
    }
}

Hello @selected-pixel-jameson
Can you please test #3196 and let us know if it fixed in your scenario ? Read the business rules in the PR thread.
Thanks,
Pedro

@pxpm Thank you for the response. I'm not sure if I did this right or not, but I overrode the files in the vendor/backpack/src/ folder with the file sin the PR. After updating those files I attempted to create a new tag via the inline 'Add' function and received the same error.

ATM when testing a PR that is something you could do, just keep in mind that any changes that you do on vendor folder will be overridden when you 'composer update'.
Unfortunately if you get the same error I think the previous PR will not fix it.
I will keep digging because as of now I am not able to reproduce that error.
I am on it, we will eventually get to fix it sooner than later. Thanks for the time spent giving us info and testing stuff. We really appreciate it.
I will come back here as soon as I found why the hell that save action error is triggering with inline create.
Best,
Pedro

Here are the migrations I have for the data structures.
Schema::create('content_tags', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('label')->unique();
            $table->timestamps();
        });

Join Tables
Schema::create('talk_content_tag', function (Blueprint $table) {
            $table->bigInteger('content_tag_id')->unsigned();
            $table->integer('talk_id')->unsigned();
            $table->integer('weight')->unsigned()->default(0);
            $table->integer('type')->unsigned()->default(0); //0 Content //1 Transcript
            $table->primary(['content_tag_id', 'talk_id'], "content_tag_id_talk_id");
            $table->foreign('content_tag_id')->references('id')->on('content_tags');
            $table->foreign('talk_id')->references('id')->on('talks');
            $table->timestamps();
        });

        Schema::create('group_content_tag', function (Blueprint $table) {
            $table->bigInteger('content_tag_id')->unsigned();
            $table->integer('group_id')->unsigned();
            $table->integer('weight')->unsigned()->default(0);
            $table->primary(['content_tag_id', 'group_id'], "content_tag_id_group_id");
            $table->foreign('content_tag_id')->references('id')->on('content_tags');
            $table->foreign('group_id')->references('id')->on('groups');
            $table->timestamps();
        });

This is how I'm defining the relationship for the model used on GroupCrudController.
public function content_tags()
{
return $this->belongsToMany(\App\Models\ContentTag::class, 'group_content_tag', 'group_id', 'content_tag_id')->withPivot('weight')->orderBy('weight', 'DESC');
}

Really would like to get this implemented as it's in production software right now and the clients can't use it.

Do you happen to have a dev stage that you could give me access ? What is the exact BP version you are using ? php artisan backpack:version
If you happen to have a dev stage that you could let me access my email is on my github profile to send details.
Working on the PR I linked to you today I did setup M-M relationship with Inline Create and I got no errors. There must be something different, I might happen that is not something 'directly' connected with InlineCreate but with some other part of the software that causes InlineCreate to fail.
Is my best wish to find the culprit and fix it, just can't found it yet :| so sorry.
Best,
Pedro

PHP VERSION:
PHP 7.3.15-3+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Feb 23 2020 07:23:33) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.15, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.15-3+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
LARAVEL VERSION:
v6.18.38@94a29cadcc0d48b89b4aa820f414fb7721ba0e22
BACKPACK VERSION:
4.1.21@187bb0c3ce52ac2bfefeb9cd7518fec27a82ebcc
Give me a second on the development environment...

Are you referring to the admin site or are you saying you want access to the actual code??

I would need access to the code, not the admin area. Well, technically both would work better so I can try to debug what you have different from me that InlineCreate is broken for your M-M and not mine :) You can setup something with only those controllers/models etc so I can test it, no need for full application.
This is not something that I usually do, but since InlineCreate is one of my babies, and a very cool feature (I think atleast), I want it to be working like a breeze, and this issue opened is bothering me for a while and I am eager to close it ASAP.
Thank you very much,
Pedro

I can't give you access to the code. This is a commercial project. I appreciate your support, but I can't spend hours helping you fix this issue.

I deleted the admin account I setup for you since it's not what you were looking for.

I understand. I will try replicate from the information you gave. It would be easier for me, but I will try and get back to you with the findings.
Btw, I didn't login.
Wish you the best,
Pedro

Well this is weird. I can't replicate the error either.
Ok... so let's see what we can do about this - it'll be a tricky one, since it's a blind fix.
(1) What if we fix the getSaveActionByOrder() method directly?
@selected-pixel-jameson , what if you make this small change inside your SaveActions.php?
    public function getSaveActionByOrder($order)
    {
-        return array_filter($this->getOperationSetting('save_actions'), function ($arr) use ($order) {
+        return array_filter($this->getOperationSetting('save_actions') ?? [], function ($arr) use ($order) {
            return $arr['order'] == $order;
        });
    }

If the actual saving works, and the only problem is that getOperationSetting('save_actions') returns null instead of [], this should fix that particular problem. We still don't know how it got to be null, but at least it'll work when it is null.
Alternatively, instead of editing the files in your vendor folder, you can do composer require backpack/crud:"dev-fix-2709 as 4.1.99" to use the branch that contains the fix above. You can then revert using composer require backpack/crud:"4.1.*"
(2) If you still get the error after the above, can you please share the Flare.io link?
The error trace might provide extra information that we missed in the dump you provided above.

(3) If you still get the error, maybe you can share a video/gif of the browser when triggering the error?
Maybe that'll provide some additional insight in what we're doing differently than you, when testing.

https://www.screentogif.com is a good one for Windows AFAIK;
https://gifox.io is what I use on Mac;

Sorry this takes so much back-and-forth to solve. But without being able to replicate it ourselves, the only way to solve it for you is to ask you to try stuff. I'm pretty confident the fix I proposed above will fix this though. I'm just wondering if there won't be something else that fails afterwards, since we're not fixing the problem, just its result.
Cheers!

Thank you,
Where is the SaveActions.php file located?
The error that is returned is not returned via Flare.IO. It’s returned via the HTTP response since the call to save the new tag to the parent content is made via javascript.
Jameson Parker
Owner & Software Engineer
www.selectedpixel.com
www.linkedin.com/in/jamesonwparker
(920) 203-4106

On Sep 16, 2020, at 9:57 AM, Cristian Tabacitu<EMAIL_ADDRESS>wrote:
Well this is weird. I can't replicate the error either.
Ok... so let's see what we can do about this - it'll be a tricky one, since it's a blind fix.
(1) What if we fix the getSaveActionByOrder() method directly?
@selected-pixel-jameson https://github.com/selected-pixel-jameson , what if you make this small change inside your SaveActions.php?
public function getSaveActionByOrder($order)
{

   return array_filter($this->getOperationSetting('save_actions'), function ($arr) use ($order) {

   return array_filter($this->getOperationSetting('save_actions') ?? [], function ($arr) use ($order) {
      return $arr['order'] == $order;
  });

}
If the actual saving works, and the only problem is that getOperationSetting('save_actions') returns null instead of [], this should fix that particular problem. We still don't know how it got to be null, but at least it'll work when it is null.

Alternatively, instead of editing the files in your vendor folder, you can do composer require backpack/crud:"dev-fix-2709 as 4.1.99" to use the branch that contains the fix above. You can then revert using composer require backpack/crud:"4.1.*"
(2) If you still get the error after the above, can you please share the Flare.io link?
The error trace might provide extra information that we missed in the dump you provided above.
https://user-images.githubusercontent.com/1032474/93353058-7c2dec80-f809-11ea-8e7a-8928b153988d.gif
(3) If you still get the error, maybe you can share a video/gif of the browser when triggering the error?
Maybe that'll provide some additional insight in what we're doing differently than you, when testing.
https://www.screentogif.com https://www.screentogif.com/ is a good one for Windows AFAIK;
https://gifox.io https://gifox.io/ is what I use on Mac;
Sorry this takes so much back-and-forth to solve. But without being able to replicate it ourselves, the only way to solve it for you is to ask you to try stuff. I'm pretty confident the fix I proposed above will fix this though. I'm just wondering if there won't be something else that fails afterwards, since we're not fixing the problem, just its result.
Cheers!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/Laravel-Backpack/CRUD/issues/2708#issuecomment-693462538, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGXF36J6OKLTHJS25B7QBOLSGDG7LANCNFSM4MQ357RQ.

The error that is returned is not returned via Flare.IO. It’s returned via the HTTP response since the call to save the new tag to the parent content is made via javascript.

Where is the SaveActions.php file located?

It's in vendor/backpack/crud/src/app/Library/CrudPanel/Traits/SaveActions.php

You should be able to see a cleaner diff here - https://github.com/Laravel-Backpack/CRUD/pull/3209/files

Well, we have some progress.
When I updated the SaveAction.php file I started receiving a different error.
{
    "message": "Undefined variable: redirectUrl",
    "exception": "ErrorException",
    "file": "/home/vagrant/code/healthmeans-laravel/vendor/backpack/crud/src/app/Library/CrudPanel/Traits/SaveActions.php",
    "line": 354,
    "trace": [
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/backpack/crud/src/app/Library/CrudPanel/Traits/SaveActions.php",
            "line": 354,
            "function": "handleError",
            "class": "Illuminate\\Foundation\\Bootstrap\\HandleExceptions",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/backpack/crud/src/app/Http/Controllers/Operations/CreateOperation.php",
            "line": 88,
            "function": "performSaveAction",
            "class": "Backpack\\CRUD\\app\\Library\\CrudPanel\\CrudPanel",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/backpack/crud/src/app/Http/Controllers/Operations/InlineCreateOperation.php",
            "line": 78,
            "function": "store",
            "class": "App\\Http\\Controllers\\Admin\\ContentTagCrudController",
            "type": "->"
        },
        {
            "function": "storeInlineCreate",
            "class": "App\\Http\\Controllers\\Admin\\ContentTagCrudController",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Routing/Controller.php",
            "line": 54,
            "function": "call_user_func_array"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php",
            "line": 45,
            "function": "callAction",
            "class": "Illuminate\\Routing\\Controller",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
            "line": 219,
            "function": "dispatch",
            "class": "Illuminate\\Routing\\ControllerDispatcher",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
            "line": 176,
            "function": "runController",
            "class": "Illuminate\\Routing\\Route",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 681,
            "function": "run",
            "class": "Illuminate\\Routing\\Route",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 130,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/backpack/crud/src/app/Http/Controllers/CrudController.php",
            "line": 43,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 153,
            "function": "Backpack\\CRUD\\app\\Http\\Controllers\\{closure}",
            "class": "Backpack\\CRUD\\app\\Http\\Controllers\\CrudController",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
            "line": 21,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 171,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/app/Http/Middleware/CheckIfAdmin.php",
            "line": 63,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 171,
            "function": "handle",
            "class": "App\\Http\\Middleware\\CheckIfAdmin",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php",
            "line": 41,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 171,
            "function": "handle",
            "class": "Illuminate\\Routing\\Middleware\\SubstituteBindings",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php",
            "line": 77,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 171,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php",
            "line": 49,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 171,
            "function": "handle",
            "class": "Illuminate\\View\\Middleware\\ShareErrorsFromSession",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php",
            "line": 56,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 171,
            "function": "handle",
            "class": "Illuminate\\Session\\Middleware\\StartSession",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php",
            "line": 37,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 171,
            "function": "handle",
            "class": "Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php",
            "line": 67,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 171,
            "function": "handle",
            "class": "Illuminate\\Cookie\\Middleware\\EncryptCookies",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 105,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 683,
            "function": "then",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 658,
            "function": "runRouteWithinStack",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 624,
            "function": "runRoute",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 613,
            "function": "dispatchToRoute",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
            "line": 170,
            "function": "dispatch",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 130,
            "function": "Illuminate\\Foundation\\Http\\{closure}",
            "class": "Illuminate\\Foundation\\Http\\Kernel",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php",
            "line": 65,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 171,
            "function": "handle",
            "class": "Barryvdh\\Debugbar\\Middleware\\InjectDebugbar",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
            "line": 21,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 171,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
            "line": 21,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 171,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php",
            "line": 27,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 171,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php",
            "line": 63,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 171,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/fideloper/proxy/src/TrustProxies.php",
            "line": 57,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 171,
            "function": "handle",
            "class": "Fideloper\\Proxy\\TrustProxies",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 105,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
            "line": 145,
            "function": "then",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
            "line": 110,
            "function": "sendRequestThroughRouter",
            "class": "Illuminate\\Foundation\\Http\\Kernel",
            "type": "->"
        },
        {
            "file": "/home/vagrant/code/healthmeans-laravel/public/index.php",
            "line": 55,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Kernel",
            "type": "->"
        }
    ]
}

Jameson Parker
Owner & Software Engineer
www.selectedpixel.com
www.linkedin.com/in/jamesonwparker
(920) 203-4106

On Sep 16, 2020, at 10:05 AM, Cristian Tabacitu<EMAIL_ADDRESS>wrote:
You should be able to see a cleaner diff here - https://github.com/Laravel-Backpack/CRUD/pull/3209/files https://github.com/Laravel-Backpack/CRUD/pull/3209/files
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/Laravel-Backpack/CRUD/issues/2708#issuecomment-693467754, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGXF36K2DP5W3XWC5WCHIULSGDH3XANCNFSM4MQ357RQ.

I also started to work on this fix, but before sending the PR my head said to me: "Cristian will never accept this fix without knowing the underlaying problem".
This is like when people have the yellow warning lights in the car display and need to go to inspection, they know it will not be approved so they just say to the mechanic to "turn them off for a while so I can be approved in car inspection" without actually fixing the error.
I am not saying there is no error here, but just "turning off the lights to pass the inspection" is not a good way to go.
EDIT:
The above error is because we are performing save actions without any action there.
My recomendation is to update the @tabacitu code to:
if(is_null($this->getOperationSetting('save_actions'))) {
$this->setupDefaultSaveActions();
}

return array_filter($this->getOperationSetting('save_actions'), function ($arr) use ($order) {
            return $arr['order'] == $order;
        });

I don't agree with this, something might need a better fix than this, but anyway, this should get you going.
Best,
Pedro

This did in fact fix the issue.
Can I overwrite this file outside of the vendor files? Committing the Vendor files to the repo is not an option.
Jameson Parker
Owner & Software Engineer
www.selectedpixel.com
www.linkedin.com/in/jamesonwparker
(920) 203-4106

On Sep 16, 2020, at 10:17 AM, Pedro Martins<EMAIL_ADDRESS>wrote:
I also started to work on this fix, but before sending the PR my head said to me: "Cristian will never accept this fix without knowing the underlaying problem".
This is like when people have the yellow warning lights in the car display and need to go to inspection, they know it will not be approved so they just say to the mechanic to "turn them off for a while so I can be approved in car inspection" without actually fixing the error.
I am not saying there is no error here, but just "turning off the lights to pass the inspection" is not a good way to go.
EDIT:
The above error is because we are performing save actions without any action there.
My recomendation is to update the @tabacitu https://github.com/tabacitu code to:
if(is_null($this->getOperationSetting('save_actions'))) {
$this->setupDefaultSaveActions();
}
return array_filter($this->getOperationSetting('save_actions'), function ($arr) use ($order) {
return $arr['order'] == $order;
});
I don't agree with this, something might need a better fix than this, but anyway, this should get you going.
Best,
Pedro
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/Laravel-Backpack/CRUD/issues/2708#issuecomment-693475524, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGXF36MVKGTMSQNMUUAIQ6LSGDJIXANCNFSM4MQ357RQ.

Somehow, somewhat, somewhere your setup is not calling the setup default save actions. This is the problem
Because like I discussed with @tabacitu in my attemps to reproduce this, I have, indeed the save actions in the inline controller, because we init all the controller defaults, plus the create operation so we can get the fields.
Could this be related to your "permissions check" in controller that prevents the controller from building correctly?
This file is internal and can't be overriden outside of vendor folder. But don't rush into do this, it's a bad pratice and could get you troubles in future. It's my advice, but ofc you are free to do wtv your desire is.
Thanks for the time spent helping us in debbuging this.
Best,
Pedro

I have remove the AccessControl Trait and the call to $this->updateAccessControls(); and I still receive the same error.
We are using the permission manager and I’m wondering if that has something to do with it.
This is our Permission Manager config.
 [
        'user'       => App\User::class,
        'permission' => Backpack\PermissionManager\app\Models\Permission::class,
        'role'       => Backpack\PermissionManager\app\Models\Role::class,
    ],

    /*
    |--------------------------------------------------------------------------
    | Disallow the user interface for creating/updating permissions or roles.
    |--------------------------------------------------------------------------
    | Roles and permissions are used in code by their name
    | - ex: $user->hasPermissionTo('edit articles');
    |
    | So after the developer has entered all permissions and roles, the administrator should either:
    | - not have access to the panels
    | or
    | - creating and updating should be disabled
    */

    'allow_permission_create' => true,
    'allow_permission_update' => true,
    'allow_permission_delete' => true,
    'allow_role_create'       => true,
    'allow_role_update'       => true,
    'allow_role_delete'       => true,

    /*
    |--------------------------------------------------------------------------
    | Multiple-guards functionality
    |--------------------------------------------------------------------------
    |
    */
    'multiple_guards' => false,

    'roles_with_admin_access' => ['admin', 'moderator', 'customer service'],
];

We are also using custom routes.

Routes/backpack/custom.php

 config('backpack.base.route_prefix', 'admin'),
    'middleware' => ['web', config('backpack.base.middleware_key', 'admin')],
    'namespace'  => 'App\Http\Controllers\Admin',
], function () { // custom admin routes

    // ------- BACKPACK CRUD ROUTES ---------------//
    Route::crud('speaker', 'SpeakerCrudController');
    Route::crud('group', 'GroupCrudController');
    Route::crud('channel', 'ChannelCrudController');
    Route::crud('subchannel', 'SubChannelCrudController');
    Route::crud('talk', 'TalkCrudController');
    Route::crud('user', 'UserCrudController');
    Route::crud('subscription', 'SubscriptionCrudController');
    Route::crud('sitesetting', 'SiteSettingCrudController');
    Route::crud('content_tag', 'ContentTagCrudController');
    Route::crud('hto/account', 'HTOAccountCrudController');
    Route::crud('hto/event', 'HTOEventCrudController');
    Route::crud('hto/event/sponsor', 'HTOEventSponsorCrudController');
    Route::crud('hto/offer', 'HTOOfferCrudController');
    Route::crud('hto/offer/type', 'HTOOfferTypeCrudController');
    Route::crud('hto/segment', 'HTOSegmentCrudController');
    Route::crud('hto/advertisement', 'HTOAdvertisementCrudController');
    Route::crud('hto/domain', 'HTODomainCrudController');
    Route::crud('hto/webhook', 'HTOWebhookCrudController');

    /* -------- CUSTOM API ROUTES --------------------------------------
        The routes below are custom endpoints used for ajax requests
        both in Backpack CRUD fields as well as custom vue fields
       ----------------------------------------------------------------*/

    //--- HTOOffer Endpoints --//
    Route::get('/api/hto/offer', 'Api\HTOOfferController@index');
    Route::get('/api/hto/offer/{id}', 'Api\HTOOfferController@show');

    //--- HTOTrackingId Endpoints --//
    Route::get('/api/hto/trackingid', 'Api\TrackingIdController@index');
    Route::get('/api/hto/trackingid/{id}', 'Api\TrackingIdController@show');

    //--- HTOEvent Endpoints --//
    Route::get('/api/hto/event', 'Api\HTOEventController@index');
    Route::get('/api/hto/event/{id}', 'Api\HTOEventController@show');
    Route::get('/api/hto/sponsor', 'Api\HTOEventSponsorController@index');
    Route::get('/api/hto/sponsor/{id}', 'Api\HTOEventSponsorController@show');

    //--- GROUP endpoints ---//
    Route::get('/api/group/{gid}/talks', 'Api\GroupController@talks');
    Route::get('/api/group/{gid}/speakers', 'Api\GroupController@speakers');
    Route::delete('/api/group/{gid}/speakers/{sid}', 'Api\GroupController@deleteSpeaker');
    Route::post('/api/group/{gid}/speakers/{sid}', 'Api\GroupController@addSpeaker');
    Route::delete('/api/group/{gid}/talks/{tid}', 'Api\GroupController@deleteTalk');
    Route::post('/api/group/{gid}/talks/{tid}', 'Api\GroupController@addTalk');
    Route::get('/api/group', 'Api\GroupController@index');
    Route::get('/api/group/{id}', 'Api\GroupController@show');
    Route::get('/api/group-filter', 'Api\GroupController@filter');

    //--- CHANNEL endpoints --- //
    Route::post('/api/channel/{cid}/ordersubchannels', 'Api\ChannelController@orderSubChannels');
    Route::post('/api/channel/{cid}/subchannel/{scid}', 'Api\ChannelController@addSubChannel');
    Route::delete('/api/channel/{cid}/subchannel/{scid}', 'Api\ChannelController@removeSubChannel');
    Route::get('/api/channel/{cid}/talks', 'Api\ChannelController@talks');
    Route::post('/api/channel/{gid}/talks/{tid}', 'Api\GroupController@addTalk');
    Route::delete('/api/channel/{gid}/talks/{tid}', 'Api\GroupController@deleteTalk');
    Route::get('/api/channel/{cid}/subchannels', 'Api\ChannelController@subChannels');
    Route::get('/api/channel', 'Api\GroupController@channel');
    Route::get('/api/channel/{id}', 'Api\GroupController@showChannel');

    //--- SUBCHANNEL endpoints --- //
    Route::get('/api/subchannel', 'ApiController@subchannels');
    Route::get('/api/subchannel/{scid}/talks', 'Api\SubChannelController@talks');
    Route::post('/api/subchannel/{gid}/talks/{tid}', 'Api\GroupController@addTalk');
    Route::delete('/api/subchannel/{gid}/talks/{tid}', 'Api\GroupController@deleteTalk');

    //--- MEDIA endpoints --- //
    Route::post('/api/media/{id}', 'Api\MediaController@update');

    //--- USER endpoints --- //
    Route::get('/api/user', 'Api\UserController@index');
    Route::get('/api/user/{id}', 'Api\UserController@show');

    //--- SUBSCRIPTION endpoints --- //
    Route::get('/api/subscription-plan', 'Api\SubscriptionPlanController@index');
    Route::get('/api/subscription-plan/{id}', 'Api\SubscriptionPlanController@show');

    //--- SPEAKER endpoints --- //
    Route::get('/api/speaker', 'Api\SpeakerController@index');
    Route::get('/api/speaker/{id}', 'Api\SpeakerController@show');
    Route::get('/api/speaker/{id}/talks/{type}', 'Api\SpeakerController@talks');
    Route::post('/api/speaker/{id}/talks/{type}/{tid}', 'Api\SpeakerController@addTalk');
    Route::delete('/api/speaker/{id}/talks/{type}/{tid}', 'Api\SpeakerController@deleteTalk');

    //--- TALK endpoints --- //
    Route::get('/api/talks', 'ApiController@talks');
    Route::get('/api/talk/{id}', 'Api\TalkController@show');
    Route::get('/api/talk/{tid}/media', 'Api\TalkController@media');
    Route::post('/api/talk/{tid}/media/add', 'Api\TalkController@addMedia');
    Route::delete('/api/talk/{tid}/media/{mid}', 'Api\TalkController@removeMedia');
    Route::post('/api/talk/plan/update', 'Api\TalkController@updatePlan');
    Route::post('/api/talk/premium/update', 'Api\TalkController@updatePriceAndDateSettings');
    Route::post('/api/talk/premium/reset', 'Api\TalkController@resetPriceAndDateSettings');
    Route::get('/api/talk', 'Api\TalkController@index');

    //--- VIDEO endpoints --- //
    Route::get('/api/video', 'Api\VideoController@index');
    Route::get('/api/video/{id}', 'Api\VideoController@show');
}); // this should be the absolute last line of this file

Jameson Parker
Owner & Software Engineer
www.selectedpixel.com
www.linkedin.com/in/jamesonwparker
(920) 203-4106

> On Sep 16, 2020, at 10:33 AM, Pedro Martins  wrote:
>
>
> Somehow, somewhat, somewhere your setup is not calling the setup default save actions. This is the problem
>
> Because like I discussed with @tabacitu  in my attemps to reproduce this, I have, indeed the save actions in the inline controller, because we init all the controller defaults, plus the create operation so we can get the fields.
>
> Could this be related to your "permissions check" in controller that prevents the controller from building correctly?
>
> This file is internal and can't be overriden outside of vendor folder. But don't rush into do this, it's a bad pratice and could get you troubles in future. It's my advice, but ofc you are free to do wtv your desire is.
>
> Thanks for the time spent helping us in debbuging this.
>
> Best,
> Pedro
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub , or unsubscribe .
>

@selected-pixel-jameson sorry, you can't - it's inside the package so it needs a fix at that level.
@pxpm totally agree with you - I wouldn't agree with a fix like that 😆 because as you see, it just generates another error, without fixing the underlying problem. Who knows how many errors need to be fixed going downstream. It's better to go upstream and fix the underlying issue. And I totally agree with your assessment - that should be the root cause.
So let's break it down. InlineCreate does call the SaveActions, that's how the item gets saved when $this->store() gets called inside InlineCreateOperation::storeInlineCreate(). So SaveActions are important inside InlineCreate.
But for some reason, in this case, the save actions aren't there when InlineCreateOperation::storeInlineCreate() gets called. Either:

(A) they're removed somewhere
(B) they don't get added in the first place
(C) they do get added, but not for the correct operation (InlineCreate, not create)

My money is on (C). Let's see. @selected-pixel-jameson , what if - instead of any of the changes above in vendor, you just do this in your project's ContentTagCrudController?
<?php

namespace App\Http\Controllers\Admin;

use Backpack\CRUD\app\Http\Controllers\CrudController;
use App\Http\Requests\ContentTagCrudRequest;

class ContentTagCrudController extends CrudController
{
    use \Backpack\CRUD\app\Http\Controllers\Operations\InlineCreateOperation;

    use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation;
    use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
    use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
    use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
    use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;

    public function setup()
    {
        $this->crud->setModel("App\Models\ContentTag");
        $this->crud->setRoute(config('backpack.base.route_prefix').'/content_tag');
        $this->crud->setEntityNameStrings('content tag', 'content tags');
    }

    public function setupListOperation()
    {
        $this->crud->setColumns(['label']);
    }

    public function setupCreateOperation()
    {
+        $this->crud->setupDefaultSaveActions();

        $this->crud->setValidation(ContentTagCrudRequest::class);

        $this->crud->addField([
          'name' => 'label',
          'type' => 'text',
          'label' => "Label"
        ]);
    }

    public function setupUpdateOperation()
    {
        $this->setupCreateOperation();
    }
}

This fixes the problem!!
Jameson Parker
Owner & Software Engineer
www.selectedpixel.com
www.linkedin.com/in/jamesonwparker
(920) 203-4106

On Sep 16, 2020, at 10:49 AM, Cristian Tabacitu<EMAIL_ADDRESS>wrote:
@selected-pixel-jameson https://github.com/selected-pixel-jameson sorry, you can't - it's inside the package so it needs a fix at that level.
@pxpm https://github.com/pxpm totally agree with you - I wouldn't agree with a fix like that 😆 because as you see, it just generates another error, without fixing the underlying problem. Who knows how many errors need to be fixed going downstream. It's better to go upstream and fix the underlying issue. And I totally agree with your assessment - that should be the root cause.
So let's break it down. InlineCreate does call the SaveActions, that's how the item gets saved when $this->store() gets called inside InlineCreateOperation::storeInlineCreate(). So SaveActions are important inside InlineCreate.
But for some reason, in this case, the save actions aren't there when InlineCreateOperation::storeInlineCreate() gets called. Either:
(A) they're removed somewhere
(B) they don't get added in the first place
(C) they do get added, but not for the correct operation (InlineCreate, not create)
My money is on (C). Let's see. @selected-pixel-jameson https://github.com/selected-pixel-jameson , what if - instead of any of the changes above in vendor, you just do this in your project's ContentTagCrudController?
crud->setModel("App\Models\ContentTag");
        $this->crud->setRoute(config('backpack.base.route_prefix').'/content_tag');
        $this->crud->setEntityNameStrings('content tag', 'content tags');
    }

    public function setupListOperation()
    {
        $this->crud->setColumns(['label']);
    }

    public function setupCreateOperation()
    {
+        $this->crud->setupDefaultSaveActions();

        $this->crud->setValidation(ContentTagCrudRequest::class);

        $this->crud->addField([
          'name' => 'label',
          'type' => 'text',
          'label' => "Label"
        ]);
    }

    public function setupUpdateOperation()
    {
        $this->setupCreateOperation();
    }
}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub , or unsubscribe .

Awesome 🥳  Hopefully that's a good fix for you, for the time being.
Ideally though, we'd need to understand what from your project went nuts. Especially since you're not the only one - other people have reported the same thing.

So far we've narrowed it down to this line inside InlineCreateOperation's setup. What it does is that it runs the exact PHP lines from CreateOperation, so that it's set up exactly the same. That includes the default SaveActions. But for some reason, for you, it doesn't do that...
The fix above just manually calls $this->crud->setupDefaultSaveActions(); to make absolutely sure the save actions are there. But... that shouldn't be necessary... normally it's done by default by the operation.

We're in a tricky spot right now.
As far as you're concerned:

you have a fix;
you've provided every possible file we needed;

And yet from our perspective:

none of the files you provided answer "why is this happening"; they all look perfectly fine;
nothing more you can give us will answer this;

So... I'm afraid the only thing we can do is:

close PR https://github.com/Laravel-Backpack/CRUD/pull/3209 since we shouldn't fix it that way;
wait for someone else to have the same problem, maybe their code will provide more insight into this, or how we can reproduce the problem ourselves;

@mikiman2028 , @zachweix - are you still encountering this issue? Maybe you can copy-paste some controller code here, to provide more insight?

@pxpm any other ideas?! I'm at a loss here...

This works for me. Definitely keep me posted if you find a fix!
Thank you for your help. I really appreciate it.
Jameson Parker
Owner & Software Engineer
www.selectedpixel.com
www.linkedin.com/in/jamesonwparker
(920) 203-4106

On Sep 16, 2020, at 11:24 AM, Cristian Tabacitu<EMAIL_ADDRESS>wrote:
@pxpm https://github.com/pxpm any other ideas?! I'm at a loss here...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/Laravel-Backpack/CRUD/issues/2708#issuecomment-693516956, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGXF36NYQDFAUPQ6MWTFRYDSGDRFJANCNFSM4MQ357RQ.

I am also at loss here. Unless something is preventing/removed when overriding some function (mean, create() and/or store()) I can't figure how this could happen.
From InlineCreate:
protected function setupInlineCreateDefaults()
    {
        if (method_exists($this, 'setup')) {
            $this->setup();
        }
        if (method_exists($this, 'setupCreateOperation')) {
            $this->setupCreateOperation();
        }

        $this->crud->applyConfigurationFromSettings('create');
    }

Could this be the order of the Operations ? I see Inline before the Create.
Not sure, but might worth try to clear our mind out of it.

@KevinRignault @selected-pixel-jameson @zachweix @mikiman2028
Please make sure that you load InlineCreateOperation AFTER the CreateOperation.
Do you see something we can do to fix this @tabacitu ?

OMG…. This fixed the issue as well. WOW.
Jameson Parker
Owner & Software Engineer
www.selectedpixel.com
www.linkedin.com/in/jamesonwparker
(920) 203-4106

On Sep 16, 2020, at 12:43 PM, Pedro Martins<EMAIL_ADDRESS>wrote:
@KevinRignault https://github.com/KevinRignault @selected-pixel-jameson https://github.com/selected-pixel-jameson @zachweix https://github.com/zachweix @mikiman2028 https://github.com/mikiman2028
Please make sure that you load InlineCreateOperation AFTER the CreateOperation.
Do you see something we can do to fix this @tabacitu https://github.com/tabacitu ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/Laravel-Backpack/CRUD/issues/2708#issuecomment-693558554, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGXF36K4BKCXVBFNLB7JM43SGD2NBANCNFSM4MQ357RQ.

I tested all you gave us, except the controller/model headers, I just used some I had here and changed the names to match yours, but the operations were already defined and I let them. (In correct order).
Sorry for letting this slip.
Best,
Pedro

Hahaha! Well... with the amount of effort everybody's put into this... it was bound to be something small 😀 I was expecting one character but apparently it can be even smaller 😅
It makes sense now that you mention it @pxpm . InlineCreate can't re-use Create's setup, if it's not already there. Very good catch!
I think the best fix is to add this to the docs 😀

Yes! In LARGE BOLD LETTERS.
Jameson W Parker

On Sep 16, 2020, at 1:01 PM, Cristian Tabacitu<EMAIL_ADDRESS>wrote:

Hahaha! Well... with the amount of effort everybody's put into this... it was bound to be something small 😀 I was expecting one character but apparently it can be even smaller 😅
It makes sense now that you mention it @pxpm . InlineCreate can't re-use Create's setup, if it's not already there. Very good catch!
I think the best fix is to add this to the docs 😀
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.

Done: https://github.com/Laravel-Backpack/docs/commit/e2ae6718de4041682322f4ad71a28fcc147d267e
Thanks again for sticking with us @selected-pixel-jameson - this was a tricky one indeed 😆
@pxpm - I think I owe you a beer for this one 🍺

It's taken months, but that's it. Once I moved InlineCreate below Create, it worked and everything saved properly

Maybe we can make a change that an error should be thrown if inline create is included before create?

Hello @all I have the same error but I don't use InlineCreateOperation
@tabacitu fix, resolve the problem when I add $this->crud->setupDefaultSaveActions(); in my edit function.

class PersonCrudController extends CrudController
{
    use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation;
    use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation { store as traitStore; }
    use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation { edit as traitEdit; update as traitUpdate; }
    use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation { show as traitShow; }

     //....

    public function edit($id)
    {
        $this->crud->setupDefaultSaveActions(); // Fix the problem

        $content = $this->traitEdit($id);
        return $content;
    }

  //...
}

I will investigate to know why in my case.

@pxpm @tabacitu I just saw the same error about array_filter come through on Sentry. In my case this is just a normal Update operation.
Looking at the code, there seems to be a potential for getOperationSetting() to return null because it tries to fall back to config('backpack.crud.operations.'.$this->getCurrentOperation().'.'.$key). There is no save_actions key in the crud configuration file, so this would always return null.
I'm not sure of the full conditions of the error since I did not encounter it myself. I am not overriding edit() in this case. Here is the stack trace.

@pxpm @tabacitu I just saw the same error about array_filter come through on Sentry. In my case this is just a normal Update operation.
Looking at the code, there seems to be a potential for getOperationSetting() to return null because it tries to fall back to config('backpack.crud.operations.'.$this->getCurrentOperation().'.'.$key). There is no save_actions key in the crud configuration file, so this would always return null.
I'm not sure of the full conditions of the error since I did not encounter it myself. I am not overriding edit() in this case. Here is the stack trace.


Does Data Type Representation indeed need a Version?

Version requires that any id of a Representation is compound, with Code & Version.   Do we intend to version the codes often enough to make the complexity worthwhile?

@zwing99 has proposed that we version the entire collection of Representations using semantic versioning.  As such, we would carry a single Representation version number across the entire Application Data Model.   Data consumers would simply reference the appropriate version of the codes.   As such, we could remove the version from each Representatation.   @strhea  and I like the solution.  @aferreyra what are your thoughts?

@zwing99 has proposed that we version the entire collection of Representations using semantic versioning. As such, we would carry a single Representation version number across the entire Application Data Model. Data consumers would simply reference the appropriate version of the codes. As such, we could remove the version from each Representatation. @strhea and I like the solution. @aferreyra what are your thoughts?

Yes, please version them as one!

I think it’s fine to version the whole thing. I assume an API implementation will have a ModDate on each entry to facilitate synchronization.
Thanks,
Andres
Get Outlook for iOShttps://aka.ms/o0ukef

From: Zac Oler @.>
Sent: Wednesday, September 20, 2023 11:33:27 AM
To: ADAPT/Standard @.>
Cc: Ferreyra Andres USRS @.>; Mention @.>
Subject: Re: [ADAPT/Standard] Does Data Type Representation indeed need a Version? (Issue #108)
https://github.com/zwing99
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

@zwing99 has proposed that we version the entire collection of Representations using semantic versioning. As such, we would carry a single Representation version number across the entire Application Data Model. Data consumers would simply reference the appropriate version of the codes. As such, we could remove the version from each Representatation. @strheahttps://github.com/strhea and I like the solution. @aferreyrahttps://github.com/aferreyra what are your thoughts?
Yes, please version them as one!
—
Reply to this email directly, view it on GitHubhttps://github.com/ADAPT/Standard/issues/108#issuecomment-1727855635, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACGW26AOW64LCXIGXTP4JF3X3L5DPANCNFSM6AAAAAA2RU3QX4.
You are receiving this because you were mentioned.Message ID: @.***>
This message may contain confidential information. If you are not the designated recipient, please notify the sender immediately, and delete the original and any copies. Any use of the message by you is prohibited.

Works for me!


Carthage Build failed xcode 12.3

ld: library not found for -lmbgl-core
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Our build pipeline has come a long way since this issue was opened. Feel free to reopen if it's still an issue in Xcode 14 with the latest main.


node010 0.10.45

Does the internal npm need updating at all? The upstream Changelog should advise you if npm was updated by them.

@DomT4 ditto to the comment left by @chrmoritz in #1253

Merged in https://github.com/Homebrew/homebrew-versions/commit/457fb26ee7ea31030375ef444c0a4534a077793a. Thanks again!


Fixed warning "Warning (bytecomp): reference to free variable 'log4slime-mode'".

This warning popped in my emacs on the start during the loading of log4slime.
Just swapped two forms, because define-minor-mode macro also defines a log4slime-mode variable and should go before any function that uses this variable.

@7max please, merge this pull request.

log4cl is now maintained under the sharplispers umbrella: https://github.com/sharplispers/log4cl. If this issue is present in the master branch of that repository as well, please file an issue.


Added line highlighter enhancement

This PR is for RFE  #841 adding the following API to GenericStyledArea:
setLineHighlighterFill( Paint highlight )
setLineHighlighterOn( boolean show )
isLineHighlighterOn()

The highlighter can be styled via CSS using selectors from Path, Shape, and Node. For example:
.styled-text-area .line-highlighter { -fx-fill: lime; }
/* or */
.line-highlighter { -fx-highlight-fill: lime; }

Any added custom Selections can now also be styled via CSS using the selection's name.

This works great, thanks for adding it.  There is just one issue though, if the line is empty, if the paragraph has zero length, then the highlight isn't shown.

A couple of other minor things:

The default text selection highlight color used to be a shade of blue, it now seems to be white.  How do I change the default?

When you do set a highlight line paint the same color is used for the text selection (i.e. double clicking on a word).

For my use case I'm not setting the highlight line color via CSS since in my application it is user configurable.

Just one other thing, if the line highlight paint is set it is overriding the default text selection paint.
In my stylesheet I have:
.selection
{
    -fx-fill: blue;
}

And am setting the line highlight paint via code, thus:
area.setLineHighlighterFill(Color.red);
Any selected text on that line has a red background rather than blue thus masking what text is selected.

Ok, I've made some changes that hopefully resolve the issues you reported.
Can you please test and let me know, thanks.

Yes that fixed both issues.  Thanks.

Found another issue with this I'm afraid.  The highlight can sometimes be "half" applied.
In the screenshot below you can see that the line highlight is only partially rendered.  This is on a wrapping line and occurs after I resize (by a splitpane dragger) the left hand component to be larger.  The text area contracts but the highlight will often not be fully rendered.  Moving the caret to another line renders the highlight properly.

There is another issue with this.  I've added it here to keep things in the same place, hope you don't mind.  I don't want to spam up the issues list.
If you have the line highlighter enabled and type at the start of the line then the highlight isn't drawn on the newly added text.
See below.

Thanks, I've fixed this.


Collapse type exec definition field

Enhancement Summary
The type key is kind of unnecessary. An exec defined as:
  - verb: setup
    name: drive-mount
    tags:
      - linux
    description: Mount a drive on the local machine
    spec:
      type:
        exec:
          file: //scripts/mount-drive.sh

Can be simplified to
  - verb: setup
    name: drive-mount
    tags:
      - linux
    description: Mount a drive on the local machine
    spec:
      exec:
        file: //scripts/mount-drive.sh

Better yet, if spec can be dropped, that would simplify things even more
  - verb: setup
    name: drive-mount
    tags:
      - linux
    description: Mount a drive on the local machine
    exec:
      file: //scripts/mount-drive.sh

Additional context
Need to play around with yaml tags and structs

This has been fixed. Config is slightly different but no longer an issue


[Protractor] Click function does not work, It throws Time out exception error

Node Version: v6.9.4
Protractor Version: 5.1.1
Angular Version: 1.2.28
Browser(s): Chrome
Operating System and Version MAC OS Siera - 10.12.3
protractor configuration file
exports.config = {
directConnect: true,
capabilities: {
'browserName': 'chrome'
},
framework: 'jasmine',
specs: ['./Test/LoginTest.js'],
allScriptsTimeout: 120000,
getPageTimeout: 120000,
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 120000
}
A relevant example test
There is button in the page, when i try to click using protractor , It throws time out error . Unable to click on the element. Same thing work on selenium webdriver.
Step to Reproduce
Step 1: Open website using this URL https://www.neonmob.com/login
Step 2: Enter the user name and password mentioned below and click on Login button
UserName: sharif33332
Password: 1234

Step 3: After login navigate to this URL  https://www.neonmob.com/shariftestuser  to navigate to exact page where problem occurs.

Issue :Now at this page unable to click on Trade Button and it throws time out exception error. Highlighted the same element on the above image.
Same element can be found using jQuery. Please follow the above steps to reproduce this issue.
Used the below code to click on this button
element(by.css("span[id='trade-btn']")).click();
Please let me know if you are not able to follow the steps. I believe there is an issue in protratcor

Hi @perwez123
I'm willing to check this when it's on stack overflow. In my opinion this is (still) not the correct site to ask this question.
If you put this on stack overflow, please provide your

step script. It could be an issue in there
your chrome version
your Chromedriver version

I second that please use StackOverflow or another venue for troubleshooting. The issue queue should be focused on surfacing and resolving issues with Protractor itself, not on troubleshooting.
@wswebcreation thanks for your work and willingness to help out on SO 😄


Modify minimum width and height for comments to 0

Developer's Certificate of Origin 1.1
   By making a contribution to this project, I certify that:

   (a) The contribution was created in whole or in part by me and I
       have the right to submit it under the Apache License 2.0; or

   (b) The contribution is based upon previous work that, to the best
       of my knowledge, is covered under an appropriate open source
       license and I have the right under that license to submit that
       work with modifications, whether created in whole or in part
       by me, under the same open source license (unless I am
       permitted to submit under a different license), as indicated
       in the file; or

   (c) The contribution was provided directly to me by some other
       person who certified (a), (b) or (c) and I have not modified
       it.

   (d) I understand and agree that this project and the contribution
       are public and that a record of the contribution (including all
       personal information I submit with it, including my sign-off) is
       maintained indefinitely and may be redistributed consistent with
       this project or the open source license(s) involved.

This change is for issue https://github.com/elyra-ai/pipeline-schemas/issues/82


tf.hessians vs tf.hessian_vector_product won't give the same result

I want to test whether the hessian of an objective loss is equal to the hessian vector product (HVP) of the same loss when we pass a vector of ones to the HVP function.
Here is my simple code to test this idea and surprisingly the result of the two are not the same.
I've put enough comments in the code to follow the problem easier and the hessian_vector_product function is taken from the tensorflow implementation in here:
import tensorflow as tf
import numpy as np
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import math_ops
from tensorflow import gradients

def hessian_vector_product(ys, xs, v):
  """Multiply the Hessian of `ys` wrt `xs` by `v`.
  This is an efficient construction that uses a backprop-like approach
  to compute the product between the Hessian and another vector. The
  Hessian is usually too large to be explicitly computed or even
  represented, but this method allows us to at least multiply by it
  for the same big-O cost as backprop.
  Implicit Hessian-vector products are the main practical, scalable way
  of using second derivatives with neural networks. They allow us to
  do things like construct Krylov subspaces and approximate conjugate
  gradient descent.
  Example: if `y` = 1/2 `x`^T A `x`, then `hessian_vector_product(y,
  x, v)` will return an expression that evaluates to the same values
  as (A + A.T) `v`.
  Args:
    ys: A scalar value, or a tensor or list of tensors to be summed to
        yield a scalar.
    xs: A list of tensors that we should construct the Hessian over.
    v: A list of tensors, with the same shapes as xs, that we want to
       multiply by the Hessian.
  Returns:
    A list of tensors (or if the list would be length 1, a single tensor)
    containing the product between the Hessian and `v`.
  Raises:
    ValueError: `xs` and `v` have different length.
  """

  # Validate the input
  length = len(xs)
  if len(v) != length:
    raise ValueError("xs and v must have the same length.")

  # First backprop
  grads = gradients(ys, xs)

  # grads = xs

  assert len(grads) == length

  elemwise_products = [
      math_ops.multiply(grad_elem, array_ops.stop_gradient(v_elem))
      for grad_elem, v_elem in zip(grads, v) if grad_elem is not None
  ]

  # Second backprop
  grads_with_none = gradients(elemwise_products, xs)
  return_grads = [
      grad_elem if grad_elem is not None \
      else tf.zeros_like(x) \
      for x, grad_elem in zip(xs, grads_with_none)]

  return return_grads

k = 1
tf.reset_default_graph()
a = tf.get_variable('a', [k])
#b = tf.get_variable('b', [k])
b = tf.multiply(a,a) # b = a^2
c = tf.multiply(tf.multiply(a,a),a) + tf.multiply(b,b) # c = a^3 + b^2

# Calculate the hessian of c w.r.t. a and b
# This is equivalent to the following matrix:
#    -               -
#   | 6a+12a^2    4a  |
# H=|                 |
#   | 4a          2.0 |
#    -               -

# However the following line returns this matrix or basically just the diagonal values:
#       -               -
#      | 6a+12a^2     0  |
# hess=|                 |
#      |    0        2.0 |
#       -               -
hess = tf.hessians(c, [a,b])

# while the following line which calculates Hv or H.1 = H, returns this vector:
#       -                     -
# hvp= | 6a+12a^2+4a    2.0+4a |
#       -                     -

v = [np.ones((k),dtype=np.float32),np.ones((k),dtype=np.float32)]
hvp = hessian_vector_product(c, [a,b], v)

# which is basically the summation of derivatives in hessian matrix along the rows.

# According to this observation (and similar tests),
# the result of tf.hessians always return zero for off-diagonal elements,
# which shouldn't be the case
# On the other hand hessian vector product (HVP) function, only returns the summation of hessians over rows
# and we can't access to off-diagonal elements of the hessian matrix using this function, too.

sess = tf.Session()
sess.run(tf.global_variables_initializer())

_a, _hess, _hvp = sess.run([a, hess, hvp])

This problem will be avoided if the variable b is not depended on a and thus the hessian matrix only should have values on the diagonals and all the other values will be zero. Therefore, HVP and hessian matrix would have the same values. However, as we all know this is a rare scenario and in most of the real-world applications trainable variables are depended to each other.

@yaserkl,
Sorry for the delayed response. Can you please cite the reference which states:

hessian of an objective loss is equal to the hessian vector product (HVP) of the same loss

because, the source code of Hessian_Vector_Product looks different from that of Hessians.
Thanks!


List harbor privileges/resource requirement

We should have a doc to list the resources needed to setup a harbor.
1> Hardware,
2>Software
3> Network ports used

@yixingjia we document the required ports for Harbor in the VIC docs here: https://github.com/vmware/vic-product/blob/master/docs/user_doc/vic_vsphere_admin/security_reference.md#open_ports
The other items would certainly be useful to include in the VIC docs, so I have opened https://github.com/vmware/vic-product/issues/1048 to track the doc update.

Should be fixed by
https://github.com/vmware/harbor/pull/3669


add: option to share selenium web driver in test or not

Sharing the selenium driver in the web tests is now optional.  Since sharing the web driver causes concurrency issues on e.g. WSL it can now be configured by setting the environment variable SHARE_SELENIUM_WEB_DRIVER.
Running on WSL defaults to not share the driver but can be overwritten w/ above environment variable.
All other OS will share the driver by default unless SHARE_SELENIUM_WEB_DRIVER is set to True.

test only