• Resolved saurav.rox

    (@sauravrox)


    Hello,
    First of all, thanks for your plugin. I am currently using your awesome plugin for demo import on my theme. But, while using multiple demo imports, the log file shows following error:
    —Importing customizer settings—
    Error: The customizer import file is not in a correct format. Please make sure to use the correct customizer import file.

    The code I have used for pre-defining the demos from theme is pasted below:

    /** Import content data*/
    if ( ! function_exists( 'lawyer_landing_page_pro_import_files' ) ) :
    function lawyer_landing_page_pro_import_files() {
        return array(
            array(
                'import_file_name'             => 'Default Layout',
                'local_import_file'            => get_template_directory() . '/inc/demo/content/default/lawyerpro.xml',
                'local_import_widget_file'     => get_template_directory() . '/inc/demo/content/default/lawyerpro.wie',
                'local_import_customizer_file' => get_template_directory() . '/inc/demo/content/default/lawyerpro.dat',
                'import_preview_image_url'     => get_template_directory_uri() . '/screenshot.png',
                'import_notice'                => __( 'Please waiting for a few minutes, do not close the window or refresh the page until the data is imported.', 'lawyer-landing-page-pro' ),
            ),
            array(
                'import_file_name'             => 'One Page Demo',
                'local_import_file'            => get_template_directory() . '/inc/demo/content/one-page/lawyerpro.xml',
                'local_import_widget_file'     => get_template_directory() . '/inc/demo/content/one-page/lawyerpro.wie',
                'local_import_customizer_file' => get_template_directory() . '/inc/demo/content/one-page/lawyerpro.dat',
                'import_preview_image_url'     => get_template_directory_uri() . '/inc/demo/content/one-page/screenshot.png',
                'import_notice'                => __( 'Please waiting for a few minutes, do not close the window or refresh the page until the data is imported.', 'lawyer-landing-page-pro' ),
            ),
        );       
    }
    add_filter( 'pt-ocdi/import_files', 'lawyer_landing_page_pro_import_files' );
    endif;
    
    /** Programmatically set the front page and menu */
    if ( ! function_exists( 'lawyer_landing_page_pro_after_import' ) ) :
    function lawyer_landing_page_pro_after_import( $selected_import ) {
     
        if ( 'Default Layout' === $selected_import['import_file_name'] ) {
            //Set Menu
            $primary   = get_term_by('name', 'Primary', 'nav_menu');
            $secondary = get_term_by('name', 'secondary', 'nav_menu');
            set_theme_mod( 'nav_menu_locations' , array( 
                  'primary'   => $primary->term_id, 
                  'secondary' => $secondary->term_id 
                 ) 
            );
      
        }elseif ( 'One Page Demo' === $selected_import['import_file_name'] ) {
            //Set Menu
            $primary   = get_term_by('name', 'Primary', 'nav_menu');
            $secondary = get_term_by('name', 'Primary', 'nav_menu');
            set_theme_mod( 'nav_menu_locations' , array( 
                  'primary'   => $primary->term_id, 
                  'secondary' => $secondary->term_id 
                 ) 
            );
           
        }
         
        /** Set Front page */
        $page = get_page_by_path('when-the-stakes-are-high-we-can-help-you'); /** This need to be slug of the page that is assigned as Front page */
            if ( isset( $page->ID ) ) {
            update_option( 'page_on_front', $page->ID );
            update_option( 'show_on_front', 'page' );
        }
        
        /** Blog Page */
        $postpage = get_page_by_path('blog'); /** This need to be slug of the page that is assigned as Posts page */
        if( $postpage ){
            $post_pgid = $postpage->ID;
            
            update_option( 'page_for_posts', $post_pgid );
        }
    }
    add_action( 'pt-ocdi/after_import', 'lawyer_landing_page_pro_after_import' );
    endif;

    The import process gets executed successfully but after completing it shows the above error (mentioned earlier). Because of which the customizer settings are not being imported. Would you please help me resolve this?

    Thanks and Kind regards,

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Gregor Capuder

    (@capuderg)

    Hi,

    this error notice is pointing to your cusotmizer files.

    Could you please try to import the customizer files with this plugin: https://ww.wp.xz.cn/plugins/customizer-export-import/ and see, if it works.

    Let me know, how it goes.

    Take care!

    Thread Starter saurav.rox

    (@sauravrox)

    Hello, thanks for your reply. I will definately try out your suggestion.

    Interestingly everything is working fine with the single demo import. That is, if I try to upload just single demo then all the data gets imported without any error. I don’t know what is happening there with the multiple import.

    regards,

    Plugin Author Gregor Capuder

    (@capuderg)

    Hmm… that’s very strange. That’s the first time I hear of this issue.

    Could you maybe send me the theme zip file so I can test it out? You can send it to my email at gmail.com (username is the same as on this forum).

    Take care!

    Thread Starter saurav.rox

    (@sauravrox)

    Hello,
    I tried the plugin you suggested and it showed the same error. So, it looks like the issue is with the customizer file. I will dig into this and will let you know.

    Thanks,

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi,

    OK, let me know.

    Look for any special characters you might have in the customizer settings.

    Take care!

    Thread Starter saurav.rox

    (@sauravrox)

    Hello,
    I exported my customizer settings using the plugin you suggested and tried to import it using the same plugin. But while importing it shows the following error:
    β€œError importing settings! Please check that you uploaded a customizer export file.”

    I have already opened a ticket in that plugin’s support forum. And waiting for their reply.
    Also I would like to know what sort of special characters are you trying to mention? I have just made a demo of my theme and then exported using that plugin.

    Also I would like to share something with you. I have kept characters like ‘@’, ‘+’, ‘-‘ in the input fields of customizer where email or phone is to be filled up. Is that something you are trying to point?

    Would you please explain a bit?

    It would be really nice of you.

    Thanks again!

    • This reply was modified 9 years, 2 months ago by saurav.rox.
    Thread Starter saurav.rox

    (@sauravrox)

    Hello,
    After spending sometime on this, I found that the shortcode that was given as an input in customizer was causing the issue. Because of which there was double quote(“) inside double quote(“) and that had caused that error. So, I changed it like this: [contact-form-7 id=\"21\" title=\"Contact form 1\"] and got my issue resolved.

    Anyways, thanks for your support and for this helpful plugin.
    I am gonna rate your plugin 5 stars πŸ™‚

    Thanks,

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi,

    for special characters I was thinking about quotes, non-ascii characters and so on…

    I’m glad you found the solution to your problem and thanks for sharing it here.

    Take care!

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Multiple Demo Import’ is closed to new replies.