magento2.3.5 – Undefined index: rule_id when trying to create a cart rule (coupons) after upgrading from magento 2.1 to 2.3.5

When upgrading from 2.1 to 2.3.5, I am now getting the following error when I try to create a new cart rule:

(2020-09-19 15:53:49) main.CRITICAL: Notice: Undefined index: rule_id in /var/www/html/magento2/vendor/stripe/module-payments/Observer/CouponEditObserver.php on line 29 {“exception”:”(object) (Exception(code: 0): Notice: Undefined index: rule_id in /var/www/html/magento2/vendor/stripe/module-payments/Observer/CouponEditObserver.php on line 29 at /var/www/html/magento2/vendor/magento/framework/App/ErrorHandler.php:61)”} ()

I emailed stripe support and they’ve told me it’s not them.
Any help would be appreciated. Thank you.

javascript – React: function passed in props is undefined

I have a functional component with hooks, and I’m trying to pass the update function to another component, but it’s always undefined. Here is a minimal example:

const A = () => {
    const (value, setValue) = React.useState(null);

    return (
        <div>
            <B value={value} setValue={setValue}/>
        </div>
    )
};

const B = (value: any, setValue: any) => {
    return (
        <Input value={value} onChange={e => setValue(e.target.value)}/>
    )
};

I’ve seen suggestions that involve binding or array functions, but neither work. How can I pass this function properly? Converting to a class component is possible, but in that case where do I define the hooks or what do I use instead? (All I really need is a stateful object that I can access and change from other components).

Thanks in advance.

apache2 – phpmyadmin fatal error calling undefined function mb_strpos

I just upgraded from Xubuntu 19.10 to 20.04. This moved me from php 7.3 to php 7.4.3 and phpmyadmin 4.9.5+dsfg1-2.

Everything was working prior to the upgrade. Now, I can successfully access a test php web page and I can display the PHP_info.php page. However, when I try to access phpmyadmin, it throws a fatal error recorded in the apache2 error log file. Here it is, expanded for readability:

(Tue Sep 15 20:15:09.030096 2020) (php7:error) (pid 2092141) (client ###.###.###.###:53310)
PHP Fatal error:  Uncaught Error:
Call to undefined function PhpMyAdmin\mb_strpos() in /usr/share/phpmyadmin/libraries/classes/Url.php:253
Stack trace:
#0 /usr/share/phpmyadmin/libraries/classes/Url.php(206): PhpMyAdmin\Url::getArgSeparator()
#1 /usr/share/phpmyadmin/libraries/classes/Url.php(169): PhpMyAdmin\Url::getCommonRaw()
#2 /usr/share/phpmyadmin/libraries/classes/Core.php(749): PhpMyAdmin\Url::getCommon()
#3 /usr/share/phpmyadmin/libraries/classes/Core.php(330): PhpMyAdmin\Core::linkURL()
#4 /usr/share/phpmyadmin/libraries/classes/Core.php(353): PhpMyAdmin\Core::getPHPDocLink()
#5 /usr/share/phpmyadmin/libraries/classes/Core.php(973): PhpMyAdmin\Core::warnMissingExtension()
#6 /usr/share/phpmyadmin/libraries/common.inc.php(106): PhpMyAdmin\Core::checkExtensions()
#7 /usr/share/phpmyadmin/index.php(27): require_once('/usr/share/phpm...')
#8 {main}
  thrown in /usr/share/phpmyadmin/libraries/classes/Url.php on line 253, referer: http://<server>/html/admin.html

How is it that the function mb_strpos() is not defined?

Any suggestions on how to address this?

nodejs – No SE PUEDE LEER LA PROPIEDAD TypeError: Cannot read property ‘path’ of undefined    at uploadImage

tengo un error al momento de obtener el path, me indica que no lee la propiedad length al momento de recorrer un for, les dejo el codigo.

Create.component.ts


import { Component, OnInit } from '@angular/core';
import { Project } from '../../models/projects';
import { ProjectService } from '../../services/project.service';
import { UploadService } from '../../services/upload.service';
import { Global } from '../../services/global';

@Component({
  selector: 'app-create',
  templateUrl: './create.component.html',
  styleUrls: ('./create.component.css'),
  providers : (ProjectService,UploadService)
})
export class CreateComponent implements OnInit {
  public title:string;
  public project:Project;
  public status:string;
  public filesToUpload:Array<File>;

  
  constructor(
    private _projectService:ProjectService,
    private _uploadService:UploadService
  ) {
    this.title=" Create Projects"
    this.project= new Project("","","","", "" , "","");
  
  }

  ngOnInit(): void {
  }

  onSubmit(form){
    //guardar datos
    //console.log(this.project);
    this._projectService.saveProject(this.project).subscribe(
      response=>{
        if(response.project){
          
          //subir imagen
          this._uploadService.makeFileRequest (Global.url+"upload-image/"+response.project._id, (),this.filesToUpload,"image" )
          .then((result:any)=>{

            console.log(result);

            this.status="success";
            form.reset();
            
          });

        }else{
          this.status="failed";
        }
       // console.log(response);
      },
      error=>{
        console.log(<any>error);
      }
    )
   
  };
  fileChangeEvent(fileInput:any){
    console.log(fileInput);
    this.filesToUpload = <Array<File>>fileInput.target.files;
  }
    
}

Servicio Upload.

upload.service.ts

import {Injectable} from '@angular/core';
import { Global } from './global';


@Injectable ()
export class UploadService{
    public url:string;

    constructor(){
        this.url =  Global.url;
    }

    testService (){
        return'probando el servicio de Angular';
    }

    makeFileRequest(url: string, params: Array<string>, files: Array<File>,name: string ){
        return new Promise(function(resolve, reject){
            var formData:any= new FormData();
            var xhr = new XMLHttpRequest();

            for (var i = 0; i < files.length; i++) {
                formData.append(name, files(i), files(i).name);
                
            }

            xhr.onreadystatechange=function(){
                if(xhr.readyState==4){
                    if(xhr.status== 200){
                        resolve(JSON.parse(xhr.response));
                    }else{
                        reject(xhr.response);
                    }
                }
            }
            xhr.open('POST', url,true);
            xhr.send(formData);
        });
    }
}

Al momento de cargar el formulario a nivel de consola me indica el error del que no puede leer la propiedad path

TypeError: Cannot read property 'path' of undefined
    at uploadImage (C:UsersArodrOneDriveEscritoriolinkedinbackendcontrollersproject.js:113:35)
    at Layer.handle (as handle_request) (C:UsersArodrOneDriveEscritoriolinkedinbackendnode_modulesexpresslibrouterlayer.js:95:5)

HTML estoy usando el change event.


            <p>
                <label for="image"></label>
                <input type="file" name="image" (change)="fileChangeEvent($event)">
            </p>

los datos se guardan en la BD mediante una conexion a una app y si se inserta en la BD pero, da este error.


Project {name: "cotd", models: "madera", category: "hogar", height: "10.5", width: "5.5", …}
category: null
height: null
image: ""
models: null
name: null
width: null
windows: null
__proto__: Object

Que puede estar faltando declarar que me indica que el no esta leyendo o logra ubicar la propiedad path.

php – Fatal error: Uncaught Error: Call to undefined function mysql_select_db()

Olá sou novo por aqui e estou encontrando o seguinte erro na minha conexão com o banco de dados estou estudando ainda se alguém puder me ajudar eu agradeço

Código da parte da conexão

to com o seguinte erro:
Fatal error: Uncaught Error: Call to undefined function mysql_select_db() in C:xampphtdocsosindex.php:3 Stack trace: #0 {main} thrown in C:xampphtdocsosindex.php on line 3

Segue o código da pagina index aonde está dando o erro acima

// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
}

$loginFormAction = $_SERVER(‘PHP_SELF’);
if (isset($_GET(‘accesscheck’))) {
$_SESSION(‘PrevUrl’) = $_GET(‘accesscheck’);
}

if (isset($_POST(‘textfield’))) {
$loginUsername=$_POST(‘textfield’);
$password=$_POST(‘textfield2’);
$MM_fldUserAuthorization = “nivel”;
$MM_redirectLoginSuccess = “menu.php”;
$MM_redirectLoginFailed = “menux.php”;
$MM_redirecttoReferrer = false;
mysql_select_db($database_data, $data);

$LoginRS__query=sprintf(“SELECT login, senha, nivel FROM funcionario WHERE login=%s AND senha=%s”,
GetSQLValueString($loginUsername, “text”), GetSQLValueString($password, “text”));

$LoginRS = mysql_query($LoginRS__query, $data) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {

$loginStrGroup  = mysql_result($LoginRS,0,'nivel');

//declare two session variables and assign them
$_SESSION('MM_Username') = $loginUsername;
$_SESSION('MM_UserGroup') = $loginStrGroup;       

if (isset($_SESSION('PrevUrl')) && false) {
  $MM_redirectLoginSuccess = $_SESSION('PrevUrl');  
}
header("Location: " . $MM_redirectLoginSuccess );

}
else {
header(“Location: “. $MM_redirectLoginFailed );
}
}
?>

– Login

” method=”POST” name=”form1″ id=”form1″>

Notice: Undefined offset: 234 in … Modifier/Eav.php on line 614

since today I can’t edit products as I see the error attached:

enter image description here

enter image description here

dns – cPanel Email Deliverability – suggested SPF record includes ‘undefined’

I recently transferred a cPanel account from a legacy WHM server to a new server running WHM 90 using the WHM Transfer Tool.

On the new server I’m looking at the Email Deliverability area in cPanel, with a view to adding DKIM and SPF records to the domain DNS, which is held off the server in AWS Route 53.

Currently in the cPanel account there is no DKIM key (presumably this is something that is not transferred as part of the WHM transfer process, but no problem, I can generate a new one) and for some reason the SPF value cPanel suggests to me includes undefined.

v=spf1 +a +mx +ip4:111.222.333.444 +include:spf.mtasv.net ~undefined

From what I’ve researched the typical value here is ~all.

What’s causing the undefined value, and what’s the appropriate value for the SPF record?

dns – cPanel Email Deliverability – suggested SFP record includes ‘undefined’

I recently transferred a cPanel account from a legacy WHM server to a new server running WHM 90 using the WHM Transfer Tool.

On the new server I’m looking at the Email Deliverability area in cPanel, with a view to adding DKIM and SPF records to the domain DNS, which is held off the server in AWS Route 53.

Currently in the cPanel account there is no DKIM key (presumably this is something that is not transferred as part of the WHM transfer process, but no problem, I can generate a new one) and for some reason the SPF value cPanel suggests to me includes undefined.

v=spf1 +a +mx +ip4:111.222.333.444 +include:spf.mtasv.net ~undefined

From what I’ve researched the typical value here is ~all.

What’s causing the undefined value, and what’s the appropriate value for the SPF record?

templates – Undefined get_header function

I installed wordpress according to the site https://ipipe.ru/info/ustanovka-wordpress-na-openserver and then wanted to use underscores.me, where I entered worldelectronics and pressed the generate button (as a result, a request appeared to overwrite the wordpress files).

Fatal error: Uncaught Error: Call to undefined function get_header() in C:OSPaneldomainsworldelectronics.ruindex.php:15 Stack trace: #0 {main} thrown in C:OSPaneldomainsworldelectronics.ruindex.php on line 15

Below is the index.php file

    <?php
    /**
     * The main template file
     *
     * This is the most generic template file in a WordPress theme
     * and one of the two required files for a theme (the other being style.css).
     * It is used to display a page when nothing more specific matches a query.
     * E.g., it puts together the home page when no home.php file exists.
     *
     * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
     *
     * @package WorldElectronics
     */

    get_header();
    ?>

        <main id="primary" class="site-main">

            <?php
            if ( have_posts() ) :

                if ( is_home() && ! is_front_page() ) :
                    ?>
                    <header>
                        <h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
                    </header>
                    <?php
                endif;

                /* Start the Loop */
                while ( have_posts() ) :
                    the_post();

                    /*
                     * Include the Post-Type-specific template for the content.
                     * If you want to override this in a child theme, then include a file
                     * called content-___.php (where ___ is the Post Type name) and that will be used instead.
                     */
                    get_template_part( 'template-parts/content', get_post_type() );

                endwhile;

                the_posts_navigation();

            else :

                get_template_part( 'template-parts/content', 'none' );

            endif;
            ?>

        </main><!-- #main -->

    <?php
    get_sidebar();
    get_footer();

How to get the main page of the worldelectronics theme taken from underscores.me to display?

php – LARAVEL 7 :ErrorException Undefined index

I encounter an error using an array index in an email html template despite the fact that the index is defined as other indexes in the same array.

The trouble occurs when using the incriminated index in the email template. As far as I don’t use it things are as described below.

Things start with a controller function to send an email

   public function sendToOne(Request $request){
        if ($request->ajax()) {
            $this->validate($request, (
            'user_id'=>'required',
            'infoletter_id'=>'required'
            ));
            Log::debug('entering sendToOne with user_id '.$request->user_id);
            $infoletter=Infoletter::find($request->infoletter_id);
            $user=User::find( $request->user_id);
            $sender=User::find(1);
            $details=(
                'title'=>$infoletter->title,
                'body'=>$infoletter->body,
                'sender'=>$sender,
                'user'=>$user,
            );
            $job=(new SendEmailJob($details))->delay($request->delay);
            dispatch($job);
            $duree=$request->delay;
            $minutes=intval(($duree % 3600) / 60);
            $secondes=intval((($duree % 3600) % 60));
            return response()->json(('success'=>'Envoi de l'infolettre programmé pour '.$user->firstname.' '.$user->familyname .'. L'envoi aura lieu dans '.$minutes.' minutes et '.$secondes.' secondes.'));
        }
        else{ return 'request is not ajax';}
    }

The array involved is $details in which I pass a sender (User class) as well as a user (User class also) the recipient of the mail.
The SendEmailJob is called with $details array as argument.

Then comes the SendEmailJob

<?php

namespace AppJobs;

use IlluminateBusQueueable;
use IlluminateContractsQueueShouldQueue;
use IlluminateFoundationBusDispatchable;
use IlluminateQueueInteractsWithQueue;
use IlluminateQueueSerializesModels;
use AppMailInfoletterMail;
use IlluminateSupportFacadesMail;
use IlluminateSupportFacadesLog;
use Carboncarbon;

class SendEmailJob implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
    protected $details;
    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct($details)
    {
        $this->details=$details;
    }
    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {  
             Log::debug('entering function handle in SendEmailJob');
             Log::debug($this->details);
            $email = new InfoletterMail($this->details);           
            Mail::to($this->details('user')->email)->send($email);              
     }  
}

its constructor receive the details array as argument, and in the handle function we instantiate an InfoletterMail passing it the same array.
Notice that at this stage,assuming I don’t use the incriminated index to prevent the error, the log (Log::debug($this->details);) shows the the ‘sender’ index is present.

Then comes the InfoletterMail

<?php

namespace AppMail;

use IlluminateBusQueueable;
use IlluminateContractsQueueShouldQueue;
use IlluminateMailMailable;
use IlluminateQueueSerializesModels;
use IlluminateSupportFacadesLog;

class InfoletterMail extends Mailable
{
    use Queueable, SerializesModels;
    protected $details;
    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct($details)
    {
        $this->details=$details;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()

    {
        Log::debug('entering build in InfoletterMail');
        Log::debug($this->details);
        return $this->view('emails.infoletter')->with('details',$this->details);
    }
}

At this stage, ,assuming I don’t use the incriminated index to prevent the error,the log (Log::debug($this->details);) shows that the ‘sender’ index is present and correct.

Then comes the email’s view (emails.infoletter) assuming I use the incriminated index (‘sender’)

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    @include('emails.inc.intro')
   <p style="text-align: center;"> Bonjour {{$details('user')->firstname}} {{$details('user')->familyname}} ,</p>
    <div>
        {{$details('body')}}
    </div>
   <p style="text-align: center;"> Bien à vous,</p>
   <p style="text-align: center;">{{$details('sender')->firstname}} {{$details('sender')->familyname}}</p>

</body>
</html>

Then comes the error

Undefined index: sender (View:
/ORIGINAL-P1/LARAVEL/denentzat/resources/views/emails/infoletter.blade.php)

I cannot make out where the error comes from and I need help.