- Posts: 5
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- K2 Edit Profile shows Error in Frontend after change to PHP 7.2.7
K2 Edit Profile shows Error in Frontend after change to PHP 7.2.7
- Andreas Schrader
- Topic Author
- Offline
- New Member
Less
More
6 years 4 months ago #168486
by Andreas Schrader
K2 Edit Profile shows Error in Frontend after change to PHP 7.2.7 was created by Andreas Schrader
I have a Website with a K2 Profile Edit Site in the Frontend. When I click on the save Button, the Site throws the Error "Using $this when not in object context".
The Site and Function worked fine with PHP 7.0 but throws this Error when I changed the PHP Version to 7.1 or higher.
Do you have any suggestions, what I have to change in the Code to fix this? Changing the PHP Version back to 7.0 is not an option, because my Client wants to change the PHP Version directly to 7.2.
Thanks for your Feedback :)
The Site and Function worked fine with PHP 7.0 but throws this Error when I changed the PHP Version to 7.1 or higher.
Do you have any suggestions, what I have to change in the Code to fix this? Changing the PHP Version back to 7.0 is not an option, because my Client wants to change the PHP Version directly to 7.2.
Thanks for your Feedback :)
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
6 years 4 months ago #168495
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic K2 Edit Profile shows Error in Frontend after change to PHP 7.2.7
Are you using any overrides?
Also can you send me the line where this error occurs ?
It must have been printed or recorded in your error log.
Also can you send me the line where this error occurs ?
It must have been printed or recorded in your error log.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Andreas Schrader
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
6 years 4 months ago #168499
by Andreas Schrader
Replied by Andreas Schrader on topic K2 Edit Profile shows Error in Frontend after change to PHP 7.2.7
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
6 years 4 months ago #168522
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic K2 Edit Profile shows Error in Frontend after change to PHP 7.2.7
Can you try commenting out github.com/getk2/k2/blob/master/plugins/user/k2.php#L19
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Andreas Schrader
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
6 years 4 months ago #168527
by Andreas Schrader
Replied by Andreas Schrader on topic K2 Edit Profile shows Error in Frontend after change to PHP 7.2.7
I removed the file and now it works fine. Thanks.
I also changed the Code in line 142 to: $menu = $application->getMenu(); because the JSite will no longer work
github.com/getk2/k2/blob/master/plugins/user/k2.php#L142
I also changed the Code in line 142 to: $menu = $application->getMenu(); because the JSite will no longer work
github.com/getk2/k2/blob/master/plugins/user/k2.php#L142
Please Log in or Create an account to join the conversation.
- Andreas Schrader
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
6 years 4 months ago #168528
by Andreas Schrader
Replied by Andreas Schrader on topic K2 Edit Profile shows Error in Frontend after change to PHP 7.2.7
I removed the line and now it works fine. Thanks.
I also changed the Code in line 142 to: $menu = $application->getMenu(); because the JSite will no longer work
github.com/getk2/k2/blob/master/plugins/user/k2.php#L142
I also changed the Code in line 142 to: $menu = $application->getMenu(); because the JSite will no longer work
github.com/getk2/k2/blob/master/plugins/user/k2.php#L142
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
6 years 4 months ago #168530
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic K2 Edit Profile shows Error in Frontend after change to PHP 7.2.7
Nice :)
I will investigate why PHP 7.2 does not like this.
Care to make a PR for $menu = $application->getMenu(); ?
I will investigate why PHP 7.2 does not like this.
Care to make a PR for $menu = $application->getMenu(); ?
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Andreas Schrader
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
6 years 4 months ago #168595
by Andreas Schrader
Replied by Andreas Schrader on topic K2 Edit Profile shows Error in Frontend after change to PHP 7.2.7
Shure I will create a PR for you :)
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
6 years 4 months ago #168602
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic K2 Edit Profile shows Error in Frontend after change to PHP 7.2.7
Thank you Andreas :)
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- burnyourears
- Offline
- Senior Member
Less
More
- Posts: 66
6 years 3 months ago - 6 years 3 months ago #168619
by burnyourears
Replied by burnyourears on topic K2 Edit Profile shows Error in Frontend after change to PHP 7.2.7
I have the same problem (mentioned
here
– sorry, did not see that there's already this topic ...) and also deleted the line in the k2.php. The result: Error-Message is fixed BUT changes are not saved any more ... :/
The weird thing: When I get the error, changes are saved though ...
Andreas, after you changed the code – are changes in the user profile still saved?
The weird thing: When I get the error, changes are saved though ...
Andreas, after you changed the code – are changes in the user profile still saved?
Last edit: 6 years 3 months ago by burnyourears.
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- K2 Edit Profile shows Error in Frontend after change to PHP 7.2.7