Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Bug] window.intlTelInput is not defined #5775

Closed
cod3rshotout opened this issue Feb 17, 2025 · 3 comments
Closed

[Bug] window.intlTelInput is not defined #5775

cod3rshotout opened this issue Feb 17, 2025 · 3 comments
Labels

Comments

@cod3rshotout
Copy link

Bug report

Please note: All issues must be submitted in English. If not, they will be closed automatically.

What I did

I defined the following field in the controller:

CRUD::addField([
  'name'  => 'phone',
  'label' => 'Phone',
  'type' => 'phone',
  'tab' => $contact_tab
]);

and then I used inline_create on another controller.

What I expected to happen

When I click on the add inline btn the modal should appear.

What happened

When I clicked on the add inline btn the modal not appear, and in console the following error message is showing:

VM8860:21 Uncaught TypeError: window.intlTelInput is not a function
at bpFieldInitPhoneElement (:21:34)
at HTMLInputElement. (edit:2858:31)
at S.each (jquery.min.js?8b76a896a620:2:3003)
at S.fn.init.each (jquery.min.js?8b76a896a620:2:1481)
at initializeFieldsWithJavascript (edit:2853:76)
at triggerModal (edit:2398:9)
at Object.success (edit:2341:21)
at c (jquery.min.js?8b76a896a620:2:28327)
at Object.fireWith [as resolveWith] (jquery.min.js?8b76a896a620:2:29072)
at l (jquery.min.js?8b76a896a620:2:80045)

What I've already tried to fix it

if I comment the field the modal appear but the following error is raised:

Uncaught (in promise) ReferenceError: ClassicEditor is not defined

If I comment the textarea too, no error in console are displayed.

Is it a bug in the latest version of Backpack?

After I run composer update backpack/crud the bug... is it still there?

Yes

Backpack, Laravel, PHP, DB version

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

Additional Information

Here's some more info that could be helpful in reproducing or debugging:

  • Environment details (e.g., operating system, web server, browser): ??
  • Relevant error logs or screenshots (if any): ??

Note: Issues that cannot be reproduced or lack necessary details to diagnose could be closed.

PHP VERSION:

8.3.4

PHP EXTENSIONS:

Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, hash, iconv, json, mbstring, SPL, session, PDO, pdo_sqlite, standard, posix, random, readline, Reflection, Phar, SimpleXML, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, bcmath, exif, gd, gmp, imagick, intl, memcached, pcntl, pdo_mysql, pdo_pgsql, redis, soap, sodium, zip

LARAVEL VERSION:

11.31.0.0

BACKPACK PACKAGE VERSIONS:

backpack/basset: 1.3.6
backpack/crud: 6.7.55
backpack/filemanager: 3.0.9
backpack/generators: v4.0.7
backpack/logmanager: v5.0.2
backpack/permissionmanager: 7.2.1
backpack/pro: 2.2.22
backpack/settings: 3.1.1
backpack/theme-tabler: 1.2.15

Copy link

Based on the information provided in the knowledge sources, I can address this issue related to the phone field in Backpack's inline create functionality. This appears to be a known bug that has been reported and addressed in recent updates.

The error you're encountering, "window.intlTelInput is not defined", is likely related to the phone field not working correctly in the inline create modal. This issue has been reported and discussed in several GitHub issues:

  1. [Bug] Phone field not working in Inline Create]([Bug] Phone field not working in Inline Create #5654)
  2. [Bug] InlineCreate encountered an error with the Phone field]([Bug] InlineCreate encountered an error with the Phone field community-forum#947)

The good news is that this bug has been fixed in recent updates to Backpack. Here are the steps you should take to resolve this issue:

  1. Update your Backpack packages to the latest versions. You're currently using backpack/crud 6.7.55 and backpack/pro 2.2.22, which should include the fix. However, ensure you're on the absolute latest versions by running:

    composer update backpack/crud backpack/pro
    
  2. After updating, clear your cache and recompile assets:

    php artisan config:clear
    php artisan cache:clear
    php artisan view:clear
    php artisan basset:clear
    php artisan basset:cache
    
  3. If you're using the phone field in production, make sure to refresh your assets there as well.

If you're still experiencing issues after these steps, it's possible that there might be a conflict with other JavaScript on your page or a configuration issue specific to your setup.

For the ClassicEditor error you mentioned, this is likely related to the WYSIWYG editor and not directly connected to the phone field issue. You may need to ensure that the CKEditor scripts are properly loaded for the inline create functionality.

If the problem persists after following these steps, I recommend opening a new issue on the Backpack CRUD GitHub repository with detailed information about your setup and the steps to reproduce the issue.

Laravel-Backpack/CRUD issues Laravel-Backpack/community-forum issues

ℹ️ Please note our AI Bot does not reply to follow-ups, this will be the only AI answer in this thread. If the AI helped you find the answer, please mark it as answered or write details below so it can learn. Then close the conversation. If not, please give more information for when a human reads this. ℹ️

Relevant sources:

Github Issue (closed): [Bug] date_picker field is not working in incline create
Github Issue (closed): [Bug]
Github Issue (closed): [Bug] Inline create "Add" button doesn't show
Github Issue (open): [Bug] inlineCreate not working on hasMany relationship
Github Issue (closed): [Bug] Select2 is not clickable with inline creation modal
Github Issue (closed): [Bug] Test adding new issues automatically to the This Week project
Github Issue (closed): [Bug] Phone field not showing some numbers
Github Issue (closed): [4.1.15][Bug] Inline creation problems
Github Issue (closed): [Bug] Phone field not working in Inline Create
Github Issue (closed): [Bug] InlineCreate encountered an error with the Phone field

@jcastroa87
Copy link
Member

Hello @cod3rshotout

I try this with our demo and is working normally

Image

Could you try with an update

composer update

If the problem is still there, please share step by step to reproduce the error in my side.

I try with these versions:

### PHP VERSION:
8.3.14

### LARAVEL VERSION:
11.43.0.0

### BACKPACK PACKAGE VERSIONS:
backpack/activity-log: 2.0.6
backpack/backupmanager: v5.0.5
backpack/basset: 1.3.6
backpack/calendar-operation: 1.0.12
backpack/crud: 6.7.55
backpack/demo: dev-main
backpack/editable-columns: 3.0.11
backpack/filemanager: 3.0.10
backpack/generators: v4.0.7
backpack/language-switcher: 2.0.0
backpack/logmanager: v5.0.2
backpack/medialibrary-uploaders: 1.2.1
backpack/menucrud: v4.0.2
backpack/newscrud: 5.1.0
backpack/pagemanager: 3.3.2
backpack/permissionmanager: 7.2.1
backpack/pro: 2.2.32
backpack/revise-operation: 2.0.0
backpack/settings: 3.1.1
backpack/theme-coreuiv2: 1.2.7
backpack/theme-coreuiv4: 1.1.5
backpack/theme-tabler: 1.2.17
backpack/translation-manager: 1.0.6

Cheers.

@jcastroa87
Copy link
Member

Due to not activity, I will close this issue, but please feel free to re-open or create a new one if needed.

Cheers.

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

No branches or pull requests

2 participants