mahtab2003 / Xera

Now Introducing a new and easy way to manage your clients and MyOwnFreeHost hosting accounts.
https://xera.eu.org/
GNU General Public License v2.0
45 stars 39 forks source link

Broken Page #50

Closed OnionDev1885 closed 1 year ago

OnionDev1885 commented 1 year ago

Found a broken Page Url: /a/ssl Error: CSS doesn't loads. Image: 190137202-bba88bc7-1dc3-4002-942e-a51abc6097ec

mahtab2003 commented 1 year ago

ok let me check

AgentDeath253 commented 1 year ago

@OnionDev1885 are you using custom email templates

OnionDev1885 commented 1 year ago

@OnionDev1885 are you using custom email templates

Yes. But I have plain templates now. M planning for css ones.

4yx commented 1 year ago

Nevermind, scratch that. I had the chance to visit a newer Xera installation and it appears the issue exists anyway. No clue as to what's causing it, for some reason the header and footer that are supposed to be included in these pages aren't included in the SSL one.

AgentDeath253 commented 1 year ago

well it looks like it started after the crypto loot update

mahtab2003 commented 1 year ago

maybe

OnionDev1885 commented 1 year ago

I have noticed, that its fine till there are no SSL requests done (pending, processing, completed, any) As soon as someone issues an SSL (no matter its processed or not), the admin SSL page gives error (CSS doesn't loads)

mahtab2003 commented 1 year ago

hm m

4yx commented 1 year ago

After some extensive debugging, I was able to find out what's causing the issue. In template\default\page\admin\ssl.php, lines 77 and 81 contain the expression $this->ssl->list_count(), which breaks the code and prevents the page from loading correctly. Removing the lines that contain the expression or replacing it with a numeric value (for example 1) allows the page to load correctly again.

I'm assuming the issue exists in the function list_count in app\models\Gogetssl.php, but I have no clue as to how it would be fixed. Someone experienced in PHP could take a look and see if they can identify the issue.

greenreader9 commented 1 year ago

My guess is that the function is returning "FALSE" or NULL, Probably because there is no fallback. I will take a look tomorrow if I remember, no use looking at it on my phone.

4yx commented 1 year ago

I was able to find out what's causing it and will make a PR along with some other fixes soon.

My guess is that the function is returning "FALSE" or NULL, Probably because there is no fallback. I will take a look tomorrow if I remember, no use looking at it on my phone.

I thought to try and test this out after you mentioned it, but as my tests produced nothing, I kept checking. Then I realized that the page was showing "Showing 1 to 1 of Array entries"; realizing that the code was incorrectly returning an Array instead of counting the elements in it as intended. I'm unsure if the way I fixed it is correct, so if you could review it that would be great.

OnionDev1885 commented 1 year ago

After some extensive debugging, I was able to find out what's causing the issue. In template\default\page\admin\ssl.php, lines 77 and 81 contain the expression $this->ssl->list_count(), which breaks the code and prevents the page from loading correctly. Removing the lines that contain the expression or replacing it with a numeric value (for example 1) allows the page to load correctly again.

I'm assuming the issue exists in the function list_count in app\models\Gogetssl.php, but I have no clue as to how it would be fixed. Someone experienced in PHP could take a look and see if they can identify the issue.

so bro, can u say me what changes shall i make here? image I don't know php, so can u provide me the preview of the fixed code? [Yes I changed the whole file of admin/ssl.php from the current one. And still the issue isn't solved. I also tried clearing cookies]

4yx commented 1 year ago

so bro, can u say me what changes shall i make here? image I don't know php, so can u provide me the preview of the fixed code? [Yes I changed the whole file of admin/ssl.php from the current one. And still the issue isn't solved. I also tried clearing cookies]

I assume you also copied the new app\models\Gogetssl.php over, and cleared the cache, if you did not do those please do them. The issue was in Gogetssl.php, but it is resolved in my local installation. If you've also done those and it still does not work please let me know.

OnionDev1885 commented 1 year ago

Thank You so much for your contribution! Issue was fixed :)

4yx commented 1 year ago

Thank You so much for your contribution! Issue was fixed :)

You're very welcome! I'm glad to hear it :)