Osclass Support Forums

Osclass plugin support => Free Osclass Plugins => Topic started by: OP on December 11, 2020, 06:01:40 AM

Title: Free Ad Importer: Not able to import ads with image after osclass upgrade to 4.2
Post by: OP on December 11, 2020, 06:01:40 AM
The free ad importer (version 0.6 or 1.0) was working smoth with osclass 4.1 and previous versions. After upgrade to Osclass 4.2, the import process will stuck in the begining if found any ad with image. Only plain text ads without image can be completed succesfully.

The problem happens on all themes I have.

Title: Re: Free Ad Importer: Not able to import ads with image after osclass upgrade to 4.2
Post by: MB Themes on December 11, 2020, 09:38:21 AM
@OP
Check your browser console as well as error log.
Title: Re: Free Ad Importer: Not able to import ads with image after osclass upgrade to 4.2
Post by: OP on December 13, 2020, 04:02:33 AM
Thank! @MB Themes

Below is what I can see from the web browser console and debug log. Any ideas? Cheers!


Web browser console

Code: [Select]
jquery.min.js:2 GET mysite.com/oc-admin/index.php?page=ajax&action=custom&ajaxfile=xml_importer/ajax.php&subaction=parsead&importfile=%2Fhome%2Fbluewebs%2Fpublic_html%2Fmysite.com%2Foc-content%2Fuploads%2Fxmlimporter_ads.temp&num_ad=0&cat_info=&meta_info= 500

Debug log file

Code: [Select]
[13-Dec-2020 02:49:21 Europe/London] PHP Warning:  Illegal string offset 'error' in /home/bluewebs/public_html/mysite.com/oc-content/plugins/xml_importer/index.php on line 201
[13-Dec-2020 02:49:21 Europe/London] PHP Fatal error:  Uncaught Error: Cannot use string offset as an array in /home/bluewebs/public_html/mysite.com/oc-content/plugins/xml_importer/index.php:201
Stack trace:
#0 /home/bluewebs/public_html/mysite.com/oc-content/plugins/xml_importer/index.php(68): xmlimporter_ad(Object(DOMElement), Array, Array)
#1 /home/bluewebs/public_html/mysite.com/oc-content/plugins/xml_importer/ajax.php(15): xmlimporter_adfromfile('/home/bluewebs/...', '0', Array, Array)
#2 /home/bluewebs/public_html/mysite.com/oc-admin/ajax/ajax.php(508): require_once('/home/bluewebs/...')
#3 /home/bluewebs/public_html/mysite.com/oc-admin/index.php(132): CAdminAjax->doModel()
#4 {main}
  thrown in /home/bluewebs/public_html/mysite.com/oc-content/plugins/xml_importer/index.php on line 201
Title: Re: Free Ad Importer: Not able to import ads with image after osclass upgrade to 4.2
Post by: MB Themes on December 14, 2020, 10:42:40 AM
@oP
I would check that line #201 in index.php of plugin
Title: Re: Free Ad Importer: Not able to import ads with image after osclass upgrade to 4.2
Post by: Admir Husić on May 20, 2021, 09:55:57 PM
Same issue here. Does anybody have a fix for this?
Title: Re: Free Ad Importer: Not able to import ads with image after osclass upgrade to 4.2
Post by: MB Themes on May 21, 2021, 11:05:04 AM
@Admir
Solution was proposed, to check this line:
Code: [Select]
Uncaught Error: Cannot use string offset as an array in /home/bluewebs/public_html/mysite.com/oc-content/plugins/xml_importer/index.php:201
Connecting osclass version to this version is not correct, as error is thrown because of PHP version and insufficient error handling in plugin.
Title: Re: Free Ad Importer: Not able to import ads with image after osclass upgrade to 4.2
Post by: Admir Husić on May 23, 2021, 09:10:11 PM
@MB Themes

Every time i try to import ads, I recieve the error:

"0 ads were imported1 ads failed to import(Ads numbers: #0 : Category invalid. )". Im using the XML file which is included in the plugin, so I think the format should be fine. Any ideas?





 
Title: Re: Free Ad Importer: Not able to import ads with image after osclass upgrade to 4.2
Post by: MB Themes on May 24, 2021, 01:09:04 PM
Category invalid means that category defined in xml does not exists in your osclass installation.
Title: Re: Free Ad Importer: Not able to import ads with image after osclass upgrade to 4.2
Post by: Admir Husić on May 24, 2021, 05:46:42 PM
Category invalid means that category defined in xml does not exists in your osclass installation.

What do you mean with it does not exist in the osclass instalation?

I have manually created a new category in settings -> categories. And this category is referenced in the XML file.


For example I created the category "Cars", and the reference in the XML file looks like this:

<category>Cars</category>

I also tried (for testing purposes) to remove completely the <category> tag from the XML, and the message still the same. 
Title: Re: Free Ad Importer: Not able to import ads with image after osclass upgrade to 4.2
Post by: MB Themes on May 25, 2021, 07:52:26 AM
@Admir
I do not mean anything, just telling you what that error means.