Title: Creating default object from empty value
Last modified: August 20, 2016

---

# Creating default object from empty value

 *  Resolved [DeezNotes](https://wordpress.org/support/users/deeznotes/)
 * (@deeznotes)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/creating-default-object-from-empty-value/)
 * Warning: Creating default object from empty value in /<wp_dir>/wp-content/plugins/
   itunes-affiliate-pro/itunes-affiliate-pro.php on line 154
 * Just updated to 1.4 and now I’m getting the above error.
 * [http://wordpress.org/extend/plugins/itunes-affiliate-pro/](http://wordpress.org/extend/plugins/itunes-affiliate-pro/)

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

 *  Thread Starter [DeezNotes](https://wordpress.org/support/users/deeznotes/)
 * (@deeznotes)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/creating-default-object-from-empty-value/#post-3245322)
 * Additional info: That warning message was displayed at the beginning of every
   post that had an iTunes Affiliate link associated with it.
 * Reverting back to 1.3 resolved the issue.
 *  Plugin Author [Jorge A. Gonzalez](https://wordpress.org/support/users/nasium/)
 * (@nasium)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/creating-default-object-from-empty-value/#post-3245347)
 * Might be an issue with DOMDocument.
 * I am on vacation for another week. I will look into the issue when I get home.
 *  [grid](https://wordpress.org/support/users/grid/)
 * (@grid)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/creating-default-object-from-empty-value/#post-3245360)
 * I was getting a similar error, only mine was saying the problem was on line 155.
 * Anyway, I went in and changed that line:
 *     ```
       $doc->loadHTML(utf8_decode($text) );
       ```
   
 * to the following:
 *     ```
       $decoded_text = utf8_decode($text);
           if ( $decoded_text == '' ) {
               return $doc->saveHTML();
           }
           $doc->loadHTML($decoded_text);
       ```
   
 * Which fixed it right up.
 * Thanks Jorge, for this great plugin!
 *  [grid](https://wordpress.org/support/users/grid/)
 * (@grid)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/creating-default-object-from-empty-value/#post-3245361)
 * Note that I was also getting some errors about incorrect html, so I changed the
   loadHTML line once again to the following:
 *     ```
       $dom->strictErrorChecking = false;
           @$doc->loadHTML($decoded_text);
       ```
   
 * This is in addition to the changes made previously.
 *  Plugin Author [Jorge A. Gonzalez](https://wordpress.org/support/users/nasium/)
 * (@nasium)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/creating-default-object-from-empty-value/#post-3245362)
 * Just updated the plugin using your fixes [@grind](https://wordpress.org/support/users/grind/).
 * Update plugin to version 1.5
 * Thanks.

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

The topic ‘Creating default object from empty value’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/itunes-affiliate-pro_c19a92.svg)
 * [iTunes Affiliate Pro](https://wordpress.org/plugins/itunes-affiliate-pro/)
 * [Support Threads](https://wordpress.org/support/plugin/itunes-affiliate-pro/)
 * [Active Topics](https://wordpress.org/support/plugin/itunes-affiliate-pro/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/itunes-affiliate-pro/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/itunes-affiliate-pro/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [Jorge A. Gonzalez](https://wordpress.org/support/users/nasium/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/creating-default-object-from-empty-value/#post-3245362)
 * Status: resolved