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

Call to undefined function htmlScriptTagJsApiV3() #22

Closed
IbrahimEzat opened this issue Jun 1, 2019 · 7 comments
Closed

Call to undefined function htmlScriptTagJsApiV3() #22

IbrahimEzat opened this issue Jun 1, 2019 · 7 comments

Comments

@IbrahimEzat
Copy link

Error Exception Call to undefined function htmlScriptTagJsApiV3()

Steps to reproduce the behavior:

  1. do exact documentation of installation
  2. do exact as documentation to configure V3
  3. reload the page
  • OS: Windows 10
  • PHP version v7.1.29
  • laravel 5.8
@biscolab
Copy link
Owner

biscolab commented Jun 6, 2019

Hi @IbrahimEzat , I tested with a fresh installation and following the documentation everything is working properly.
I'm going to figure out how to fix your installation.
First of all: I'd like to know what is your server or VM OS (not Windows 10).
Then, could you please post some code snippet of your blade file?

@fferraro87
Copy link

i've also that issue that's my snippet of code layout.blade.php:

<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <title> {{$page_title}} | {{$basic->sitename}} </title>
    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-113580855-2"></script>
    <script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());
        gtag('config', 'UA-113580855-2', { 'anonymize_ip': true });
    </script>
    <!-- favicon -->
    <link rel="shortcut icon" href="{{asset('assets/images/logo/favicon.png')}}" type="image/x-icon">
    <!-- recaptcha -->
    <script src='https://www.google.com/recaptcha/api.js'></script>
    <!-- bootstrap -->
    <link rel="stylesheet" href="{{url('/')}}/assets/front/css/bootstrap.min.css">
    <!-- fontawesome icon  -->
    <link rel="stylesheet" href="{{url('/')}}/assets/front/css/fontawesome.min.css">
    <!-- flaticon css -->
    <link rel="stylesheet" href="{{url('/')}}/assets/front/fonts/flaticon.css">
    <!-- animate.css -->
    <link rel="stylesheet" href="{{url('/')}}/assets/front/css/animate.css">
    <!-- Owl Carousel -->
    <link rel="stylesheet" href="{{url('/')}}/assets/front/css/owl.carousel.min.css">
    <!-- magnific popup -->
    <link rel="stylesheet" href="{{url('/')}}/assets/front/css/magnific-popup.css">
    <!-- stylesheet -->
    <!-- <link rel="stylesheet" href="{{url('/')}}/assets/front/css/style.css"> -->
    <!-- responsive -->
    <link rel="stylesheet" href="{{url('/')}}/assets/front/css/responsive.css">
    <link href="{{asset('assets/front/css/sweetalert.css')}}" rel="stylesheet" />
    <link href="{{asset('assets/front/css/toastr.min.css')}}" rel="stylesheet" />
    @yield('css')

    <link rel="stylesheet" type="text/css" href="{{asset('assets/front/css/style.php')}}?color={{ $basic->color }}&lang=@Lang('string.caricamento')">
    {!! htmlScriptTagJsApiV3([
    'action' => 'homepage'
    ]) !!}
</head>

@IbrahimEzat
Copy link
Author

IbrahimEzat commented Jun 7, 2019

thanks @biscolab for your kind interest , i'm using Bitnami - wampstack-7.1.30-0 with php version 7.1.30 as local server before up the project , here is test code return mentioned error :

`<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" prefix="og: http://ogp.me/ns#" >
<head>
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <script type="text/javascript">
        function callbackThen(response){
            // read HTTP status
            console.log(response.status);
            
            // read Promise object
            response.json().then(function(data){
                console.log(data);
            });
        }
        function callbackCatch(error){
            console.error('Error:', error)
        }   
    </script>    
    {!! htmlScriptTagJsApiV3([
        'action' => '/',
        'callback_then' => 'callbackThen',
        'callback_catch' => 'callbackCatch'
    ]) !!}
</head>
<body>
    <form action="{{ url('/') }}" method="POST" id="contactUsForm" data-parsley-validate>
        @csrf
        <div id="contactUsForm_id"></div>
        <div class="form-group mt-4">
            <input type="text" class="form-control" name="name" id="name" placeholder="Your Name" required>
        </div>
        <div class="form-group">
            <input type="email" class="form-control" name="email" id="email" placeholder="Your Mail" data-parsley-type="email" required>
        </div>
        <div class="form-group">
            <textarea class="form-control" name="message" id="message" rows="3" placeholder="Message" required></textarea>
        </div>
        <button type="submit" class="btn btn-success btn-block mb-4">Send</button>
    </form>

</body>
</html>`

Screenshot_2019-06-06 Whoops There was an error

@biscolab
Copy link
Owner

biscolab commented Jun 7, 2019

@fferraro87 If you don't give me enough information about your installation I can't help you.

  • PHP version?
  • Laravel version?
  • Laravel reCaptcha version?
    Your layout.blade.php looks good but I bet the error starts from the installation

@IbrahimEzat I've never used wampstack and I can't replicate the same environment. I suggest you remove and reinstall the package. Please either check package discovery is working or register alias and provider in config/app.php

@fferraro87
Copy link

@biscolab i've solved, i don't know why when i installed for the first time, composer install 3.0 version.
Now i've done a composer update and now it works with last version

@biscolab
Copy link
Owner

@IbrahimEzat please check Laravel reCaptcha version you installed. Make sure you are using the latest

@IbrahimEzat
Copy link
Author

@fferraro87 Thanks for help , It works now after change composer.json require biscolab/laravel-recaptcha from 3 to 3.4.2 and update the composer.
@biscolab thanks for help , but i think you should announce somehow in your documentation to be careful with the version ,because most of users copy/past the installation code which is composer require biscolab/laravel-recaptcha:^3.0

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

No branches or pull requests

3 participants