*

pipetko

  • ****
  • 112 posts
500 errors after posting ads, no mater which version
« on: August 04, 2020, 01:20:58 PM »
Hello I am experiencing 500 errors from atleast 9 months, after posting ads.
I was with 3.8, upraded later with 3.8.1., then 3.9 and yesterday 4.1.0
with all versions the same. I have basic plugins that come with veronica and last version of veronica theme

Today I cleaned the 200 MB log from january 2020 ( last time i cleaned it ). And again tested so I can send you exact errors after posting ad. The ad is posted but instead redirecting the user to search showing the add I get 500 error.

What I see in the error log after posting an ad is this:
Code: [Select]
[04-Aug-2020 14:08:12 Europe/Sofia] PHP Warning:  current() expects parameter 1 to be array, null given in /oc-includes/osclass/emails.php on line 855
[04-Aug-2020 14:08:12 Europe/Sofia] PHP Fatal error:  Cannot declare class PHPMailer, because the name is already in use in /oc-includes/vendor/phpmailer/phpmailer/class.phpmailer.php on line 28
[04-Aug-2020 14:09:37 Europe/Sofia] PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /oc-includes/osclass/helpers/hSearch.php on line 342
[04-Aug-2020 14:10:51 Europe/Sofia] PHP Warning:  current() expects parameter 1 to be array, null given in /oc-includes/osclass/emails.php on line 855
[04-Aug-2020 14:10:51 Europe/Sofia] PHP Fatal error:  Cannot declare class PHPMailer, because the name is already in use in /oc-includes/vendor/phpmailer/phpmailer/class.phpmailer.php on line 28

P.S. Is it possible to make after post redirect to open the add directly instead of search ?!

I am not shure if the problem is related with the theme or not, please excuse me if is the wrong category to post my topic
« Last Edit: August 04, 2020, 01:25:42 PM by pipetko »

*

MB Themes

Re: 500 errors after posting ads, no mater which version
« Reply #1 on: August 04, 2020, 04:14:26 PM »
@pipetko
There is no official 4.1 version of osclass, maybe just some personal branches or customizations
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

pipetko

  • ****
  • 112 posts
Re: 500 errors after posting ads, no mater which version
« Reply #2 on: August 04, 2020, 06:55:59 PM »
Like I sayd the problem was the same with 3.8. last official version. I tried to solve it with those upgrades, and nothing changed offcorse

*

MB Themes

Re: 500 errors after posting ads, no mater which version
« Reply #3 on: August 04, 2020, 08:01:57 PM »
You have updated osclass, bug old files are still there (for php mailer).
Remove them, they are now in vendor folder.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

pipetko

  • ****
  • 112 posts
Re: 500 errors after posting ads, no mater which version
« Reply #4 on: August 05, 2020, 09:29:19 AM »
You have updated osclass, bug old files are still there (for php mailer).
Remove them, they are now in vendor folder.
Which means to remove the entire folder oc-includes/phpmailer I gues ?

P.S. I found solution for making redirect after posting ad directly to the ad itself:

Code: [Select]
if (!function_exists('veronika_redirect_to_item')) {
    function veronika_redirect_to_item($item) {
        if ($item) {
            View::newInstance()->_exportVariableToView("item", Item::newInstance()->findByPrimaryKey($item['pk_i_id']));
            osc_redirect_to(osc_item_url());
        }
    }
    osc_add_hook('posted_item', 'veronika_redirect_to_item');
}
It works awesome, also solved the 500 error with this.
I think is way better after ad post to show the ad itself not a search. Usually that is how "The Big Guys" are working too.
« Last Edit: August 05, 2020, 09:33:27 AM by pipetko »

*

MB Themes

Re: 500 errors after posting ads, no mater which version
« Reply #5 on: August 05, 2020, 09:30:12 AM »
@pipetko
I do not think it solve error, it just makes it not visible.
Yes php mailer folder, you can rename it just to test.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

pipetko

  • ****
  • 112 posts
Re: 500 errors after posting ads, no mater which version
« Reply #6 on: August 05, 2020, 09:36:11 AM »
@pipetko
I do not think it solve error, it just makes it not visible.
Yes php mailer folder, you can rename it just to test.
Not working... the entire website is 500 error now

*

pipetko

  • ****
  • 112 posts
Re: 500 errors after posting ads, no mater which version
« Reply #7 on: August 05, 2020, 09:37:15 AM »
@pipetko
I do not think it solve error, it just makes it not visible.
Yes php mailer folder, you can rename it just to test.
Not working... the entire website is not accessable ( down ) with 500 error now

Ops sorry instead of modify I clicked Quote
P.S. I know it will not solve the problem. But atleast until it is solved the users will use the website without seing error. Which for me is more than good.

Other thing. I noticed in some mirrored archive of old osclass forum that this problem was caused by PHP version. I am with 7.4 ( or atleast thats what shows in the admin pannel.

I will install WP with php review plugin to check on frontend if the php version is really changed to the latest or I am still using old version, or somehow reversed to old version, because problem was gone for some short time and then came back again.
« Last Edit: August 05, 2020, 09:46:40 AM by pipetko »

*

pipetko

  • ****
  • 112 posts
Re: 500 errors after posting ads, no mater which version
« Reply #8 on: August 05, 2020, 12:11:02 PM »
@pipetko
I do not think it solve error, it just makes it not visible.
Yes php mailer folder, you can rename it just to test.
Turns out the useless phpmailer folder is actually in oc-includes/vendor I renamed the folder ( left it there for any kase ). I found that in Osclass 4.1.0 there is only one phpmailer in the oc-includes. The other one is probably from 3.8.1 or 3.9.0 versionas I have upgraded, have no clue

Now the: [04-Aug-2020 14:08:12 Europe/Sofia] PHP Fatal error:  Cannot declare class PHPMailer, because the name is already in use in /oc-includes/vendor/phpmailer/phpmailer/class.phpmailer.php on line 28

is gone.

Now I have to figure out what to do with this one:
Code: [Select]
[05-Aug-2020 12:58:05 Europe/Sofia] PHP Warning:  current() expects parameter 1 to be array, null given in /oc-includes/osclass/emails.php on line 855
« Last Edit: August 05, 2020, 12:13:03 PM by pipetko »