Laravel-Backpack / community-forum

A workspace to discuss improvement and feature ideas, before they're actually implemented.
28 stars 0 forks source link

[Bug] InlineCreate encountered an error with the Phone field #947

Closed tringuyenduc2903 closed 1 week ago

tringuyenduc2903 commented 5 months ago

Bug report

What I did

Add a phone field to the Customer form

            CRUD::field('phone_number')
                ->label(ucfirst(trans('validation.attributes.phone_number')))
                ->type('phone')
                ->tab(trans('Main'));

Add a relationship field to the Order form


            CRUD::field('customer')
                ->label(ucfirst(trans('validation.attributes.customer')))
                ->inline_create(true);

What I expected to happen

When you press the Add button, the form will appear image

What happened

The form does not appear. Additionally, if the main form has 2 Add buttons, pressing the second Add button will open the previously failed form. Quay phim màn hình từ 17-04-2024 23:53:13.webm

Is it a bug in the latest version of Backpack?

After I run backpack composer update backpack/crud the error it still persists

Backpack, Laravel, PHP, DB version

When I run php artisan backpack:version the output is:

### PHP VERSION:
8.3.4

### PHP EXTENSIONS:
Core, date, libxml, openssl, pcre, zlib, filter, hash, json, pcntl, random, Reflection, SPL, session, standard, sodium, mysqlnd, PDO, xml, bcmath, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, iconv, igbinary, imagick, imap, intl, ldap, exif, msgpack, mysqli, pcov, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, readline, redis, shmop, SimpleXML, soap, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, zip, memcached, swoole, Zend OPcache, xdebug

### LARAVEL VERSION:
11.4.0.0

### BACKPACK PACKAGE VERSIONS:
backpack/activity-log: 2.0.3
backpack/backupmanager: v5.0.2
backpack/basset: 1.3.3
backpack/crud: 6.7.9
backpack/filemanager: 3.0.7
backpack/generators: v4.0.5
backpack/language-switcher: 2.0.0
backpack/logmanager: v5.0.1
backpack/medialibrary-uploaders: 1.2.0
backpack/permissionmanager: 7.2.0
backpack/pro: 2.1.13
backpack/revise-operation: 2.0.0
backpack/theme-tabler: 1.2.8
backpack/translation-manager: 1.0.2
karandatwani92 commented 5 months ago

Hey @pxpm

I'm not receiving exactly the above issue, BUT👇

The phone field is not being passed via inline create form, causing a required validation error. Yes, It is working fine in the Main CRUD.

pxpm commented 1 week ago

Hey @tringuyenduc2903 and @karandatwani92 it's possible that this is fixed with the latest updates.

I couldn't reproduce any of those errors:

CRUD::field('details')
        ->type('phone')
        ->size(6)
        ->tab('Texts');

image

image

I am using latest backpack/crud and latest backpack/pro.

I will be closing this, please re-open if needed. 👍

Cheers