Title: Import Data
Last modified: November 23, 2021

---

# Import Data

 *  [edival](https://wordpress.org/support/users/edival/)
 * (@edival)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/import-data-27/)
 * Trying to import the exported JSON object but getting the following error:
    [
   23-Nov-2021 17:51:19 UTC] PHP Fatal error: Uncaught TypeError: json_decode():
   Argument #1 ($json) must be of type string, array given in /home/site/wp-content/
   plugins/client-documentation/client-documentation.php:830
 * It looks like you’re trying to json_decode on a PHP array instead of a string.
   Is there a fix for this?
 * The PHP related is:
 *     ```
       $opt = $data[1]['data'];
       foreach( $set as $st ){
         if( !empty($opt[$st]) && $st == 'user_role' ) $this->settings[$st] = json_decode($opt[$st]);
         elseif( !empty($opt[$st]) ) $this->settings[$st] = $opt[$st];
       }
       ```
   

Viewing 1 replies (of 1 total)

 *  Thread Starter [edival](https://wordpress.org/support/users/edival/)
 * (@edival)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/import-data-27/#post-15096993)
 * I found a fix:
    Line 830 of client-documentation.php, remove json_decode() from
   around $opt[$st];
 * Works perfectly.

Viewing 1 replies (of 1 total)

The topic ‘Import Data’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/client-documentation_fdfdfd.svg)
 * [Simple Documentation](https://wordpress.org/plugins/client-documentation/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/client-documentation/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/client-documentation/)
 * [Active Topics](https://wordpress.org/support/plugin/client-documentation/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/client-documentation/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/client-documentation/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [edival](https://wordpress.org/support/users/edival/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/import-data-27/#post-15096993)
 * Status: not resolved