: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
import { Component, unmountComponentAtNode } from '@wordpress/element';
import PropTypes from 'prop-types';
import { __ } from '@wordpress/i18n';
} from '@wordpress/components';
export class DisplayBulkExport extends Component {
startDateTimestamp: false,
this.setForms = this.setForms.bind( this );
this.setDates = this.setDates.bind( this );
this.closeModal = this.closeModal.bind( this );
this.openModal = this.openModal.bind( this );
this.setProcessing = this.setProcessing.bind( this );
this.setExportSuccess = this.setExportSuccess.bind( this );
this.setExportError = this.setExportError.bind( this );
this.abortFetch = this.abortFetch.bind( this );
this.cancelComp = this.cancelComp.bind(this);
//Make sure there is no conflicts between components
const emailComp = document.getElementById( 'nf-trigger-emails-container' );
if( emailComp !== null ){
document.getElementById( 'nf-trigger-emails-container' )
//Prepare component to cancel all subscribtions before unmounting
//Make sure all jobs are stopped
this.setState( { forms: forms } );
this.setState( { dates } );
this.setState( { startDate: dates.date[ 0 ] } );
startDateTimestamp: Math.round(
new Date( this.state.startDate ).getTime() / 1000
this.setState( { endDate: dates.date[ 1 ] } );
endDateTimeStamp: Math.round(
new Date( this.state.endDate ).getTime() / 1000
this.setState( { isModalOpen: false } );
this.setState( { isModalOpen: true } );
this.setState( { processing: value } );
this.setState( { exportSuccess: true } );
this.setState( { exportError: true } );
this.props.data.fetchController.abort();
this.setState( { fetchAborted: true } );
//Cancel emails or Remove Component via cancel button
if(this.state.processing){
this.setProcessing( false );
this.props.data.setClose();
const globalParams = data.props.globalParams;
const setClose = data.setClose;
const signal = data.fetchController.signal;
forms.forEach( ( formID ) => {
const form = globalParams.forms[ formID ];
const title = ' ' + formID + ': ' + form.formTitle;
formTitles.push( title );
id="nf-DisplayBulkExport"
<h3>{ __( 'Bulk Form Exports', 'ninja-forms' ) }</h3>
<p>{ __( 'Select Forms', 'ninja-forms' ) }</p>
forms={ globalParams.forms }
<p>{ __( 'Select Dates', 'ninja-forms' ) }</p>
dateFormat={ globalParams.dateFormat }
<p style={ { margin: '1.2rem 0 0 0' } }>
{ __( 'Forms Selected: ', 'ninja-forms' ) +
__( 'Start Date: ', 'ninja-forms' ) +
__( 'End Date: ', 'ninja-forms' ) + endDate }
{ forms && dates && !fetchAborted && (
style={ { marginRight: '1rem' } }
triggerBulkExportAction( actionProps );
{ __( 'Export', 'ninja-forms' ) }
onClick={ () => this.openModal() }
{ __( 'Cancel', 'ninja-forms' ) }
actionText={ __( 'Yes', 'ninja-forms' ) }
cancelText={ __( 'No', 'ninja-forms' ) }
cancel={ () => this.closeModal() }
{ processing && <Spinner /> }
onClick={ () => setClose() }
{ __( 'Reopen to allow new bulk export process', 'ninja-forms' ) }
DisplayBulkExport.propTypes = {
data: PropTypes.object.isRequired,