Could you try right clicking the broken image and opening it in a new tab? It might give an error that could lead us in the right directionGuess whose site still doesn't work even after switching web hosts?? :')
Could you try right clicking the broken image and opening it in a new tab? It might give an error that could lead us in the right directionGuess whose site still doesn't work even after switching web hosts?? :')
This page isn’t workingemotidogs.online is currently unable to handle this request.Could you try right clicking the broken image and opening it in a new tab? It might give an error that could lead us in the right direction
That sounds like an issue with your host unfortunately, I don't think the code we've been doing should cause something like that. The error is just a generic one so nothing specific to help with troubleshootingThis page isn’t workingemotidogs.online is currently unable to handle this request.
HTTP ERROR 500
Weird, because x10hosting is doing it too. My original host is godaddy. What host do you use?That sounds like an issue with your host unfortunately, I don't think the code we've been doing should cause something like that. The error is just a generic one so nothing specific to help with troubleshooting
I don't currently have a host, I'm using a program called WAMP just to develop locally on my PC. It doesn't come with Imagick by default so I had to install it myself which was a huge pain lmao. I do have a version with mysidiahosting where I was testing it on a live server that does work but I don't think they offer custom domains just yet. You'd need to message Hall of Famer on here for questions to do with myshosting as they run it.Weird, because x10hosting is doing it too. My original host is godaddy. What host do you use?
Ah, I'll see if I can try mysidia hosting if I can sign up for it. Here is a link to my files. Agreed, lol. Thanks for helping me with this goose chase xDI don't currently have a host, I'm using a program called WAMP just to develop locally on my PC. It doesn't come with Imagick by default so I had to install it myself which was a huge pain lmao. I do have a version with mysidiahosting where I was testing it on a live server that does work but I don't think they offer custom domains just yet. You'd need to message Hall of Famer on here for questions to do with myshosting as they run it.
If it is the code doing it I could go through it again and see. Could you resend me the files you've been using? And a screenshot of your DB? Hopefully we can get to the bottom of it lol
Ok so I got myself a new site on mysidia hosting (https://pixellatopia.mysidiahost.com/). I've abandoned my previous idea for one that is way more unique and if it works will be insane. Not going to spoil the concept here but let's just say that my idea will require a whopping 25 markings to code in... yay me. It will be so worth it if I can get it working though. I'll start working on it today and hopefully there won't be any errors!I don't currently have a host, I'm using a program called WAMP just to develop locally on my PC. It doesn't come with Imagick by default so I had to install it myself which was a huge pain lmao. I do have a version with mysidiahosting where I was testing it on a live server that does work but I don't think they offer custom domains just yet. You'd need to message Hall of Famer on here for questions to do with myshosting as they run it.
If it is the code doing it I could go through it again and see. Could you resend me the files you've been using? And a screenshot of your DB? Hopefully we can get to the bottom of it lol
It looks like something is causing theOk so I got myself a new site on mysidia hosting (https://pixellatopia.mysidiahost.com/). I've abandoned my previous idea for one that is way more unique and if it works will be insane. Not going to spoil the concept here but let's just say that my idea will require a whopping 25 markings to code in... yay me. It will be so worth it if I can get it working though. I'll start working on it today and hopefully there won't be any errors!
Spoke too soon...
Warning: Undefined variable $adopt in /home/pixellat/public_html/model/domainmodel/ownedadoptable.php on line 132
Warning: Attempt to read property "aid" on null in /home/pixellat/public_html/model/domainmodel/ownedadoptable.php on line 132
Fatal error: Uncaught TypeError: Resource\Core\AppController::setField(): Argument #2 ($value) must be of type ?Resource\Native\Objective, string given, called in /home/pixellat/public_html/controller/main/myadoptscontroller.php on line 47 and defined in /home/pixellat/public_html/resource/core/appcontroller.php:183 Stack trace: #0 /home/pixellat/public_html/controller/main/myadoptscontroller.php(47): Resource\Core\AppController->setField('image', '/adoptimage/vie...') #1 [internal function]: Controller\Main\MyadoptsController->manage('1') #2 /home/pixellat/public_html/resource/core/frontcontroller.php(196): ReflectionMethod->invokeArgs(Object(Controller\Main\MyadoptsController), Array) #3 /home/pixellat/public_html/controller/main/indexcontroller.php(13): Resource\Core\FrontController->triggerAction() #4 /home/pixellat/public_html/resource/core/frontcontroller.php(142): Controller\Main\IndexController->triggerAction() #5 /home/pixellat/public_html/index.php(75): Resource\Core\FrontController->handleRequest() #6 /home/pixellat/public_html/index.php(84): IndexController->run() #7 /home/pixellat/public_html/index.php(88): IndexController::main() #8 {main} thrown in /home/pixellat/public_html/resource/core/appcontroller.php on line 183
Objective
object to be preemptively converted into a string. Could you put the following code in model/domainmodel/ownedadoptable.php
at the beginning of the getImage()
function (so right after line 200), and share the output please? This will help us narrow down what the function's doing before it errors out. var_dump([
'fetchMode' => $fetchMode,
'currentLevel' => $this->currentlevel,
'imageurl' => $this->imageurl,
'alternate' => $this->alternate,
'getImageUrl' => $this->getImageURL($fetchMode),
'getPrimaryImage' => $this->getCurrentLevel('model')->getPrimaryImage($fetchMode),
'getImage' => $this->getAlternate('model')->getImage($fetchMode),
]);
Tysm! Idk if I'm putting that code in the wrong place, but I can't get it to do anything.It looks like something is causing theObjective
object to be preemptively converted into a string. Could you put the following code inmodel/domainmodel/ownedadoptable.php
at the beginning of thegetImage()
function (so right after line 200), and share the output please? This will help us narrow down what the function's doing before it errors out.
PHP:var_dump([ 'fetchMode' => $fetchMode, 'currentLevel' => $this->currentlevel, 'imageurl' => $this->imageurl, 'alternate' => $this->alternate, 'getImageUrl' => $this->getImageURL($fetchMode), 'getPrimaryImage' => $this->getCurrentLevel('model')->getPrimaryImage($fetchMode), 'getImage' => $this->getAlternate('model')->getImage($fetchMode), ]);
I'm not seeing the call to var_dump in the file you attached - did you perhaps attach the other version of the file?Tysm! Idk if I'm putting that code in the wrong place, but I can't get it to do anything.
public function getImage($fetchMode = "") {
$home = SCRIPTPATH . '/';
if ($this->getLastUpdate() !== $this->getImgLastUpdate()) {
return new Image("{$home}adoptimage/view/{$this->getAdoptID()}");
} else {
return new Image("{$home}picuploads/adopt_images/{$this->getAdoptID()}.png?{$this->getImgLastUpdate()}");
}
}
That worked, although the image still isn't working. Trying to see if it has something to do with the database...? When I open the image in a new tab it just opens the index page. Here are my files.I'm not seeing the call to var_dump in the file you attached - did you perhaps attach the other version of the file?
edit: Actually, I think I see what's going on here. Assuming that the attached file is the version you're running on your site, I'm thinking that the fact that you're returning a string is what's causing that error to be raised (as opposed to something causing the Objective instance to be cast to a string).
Since the function that calls getImage() expects an instance of Objective, let's try doing this:
PHP:public function getImage($fetchMode = "") { $home = SCRIPTPATH . '/'; if ($this->getLastUpdate() !== $this->getImgLastUpdate()) { return new Image("{$home}adoptimage/view/{$this->getAdoptID()}"); } else { return new Image("{$home}picuploads/adopt_images/{$this->getAdoptID()}.png?{$this->getImgLastUpdate()}"); } }
Could you put this after line 49 in view/main/myadoptsview.php and let me know what you see? Or if you can let me know when it's up, I can go to the page and view it as well with my test account.That worked, although the image still isn't working. Trying to see if it has something to do with the database...? When I open the image in a new tab it just opens the index page. Here are my files.
$document->add(new Comment("<br><br>" . var_export($this->getField('image'), true) ."<br>"));
$document->add($image)
in case your file has any modifications and line 49 for you is something different.Resource\GUI\Component\Image::__set_state(array( 'alt' => NULL, 'src' => Resource\Utility\URL::__set_state(array( 'scheme' => NULL, 'host' => NULL, 'path' => NULL, 'query' => NULL, 'fragment' => NULL, 'url' => 'https://pixellatopia.mysidiahost.com//picuploads/adopt_images/1.png?0', )), 'width' => NULL, 'height' => NULL, 'action' => NULL, 'type' => NULL, 'containers' => array ( ), 'name' => NULL, 'visible' => true, 'align' => NULL, 'font' => NULL, 'foreground' => NULL, 'background' => NULL, 'css' => NULL, 'container' => NULL, 'lineBreak' => false, 'id' => NULL, 'class' => NULL, 'event' => NULL, 'attributes' => ArrayObject::__set_state(array( 'Src' => true, )), 'renderer' => Resource\GUI\Renderer\AccessoryRenderer::__set_state(array( 'tag' => 'img', 'component' => NULL, 'render' => '', 'status' => 'ready', )), ))Could you put this after line 49 in view/main/myadoptsview.php and let me know what you see? Or if you can let me know when it's up, I can go to the page and view it as well with my test account.
PHP:$document->add(new Comment("<br><br>" . var_export($this->getField('image'), true) ."<br>"));
The above line should be placed right after$document->add($image)
in case your file has any modifications and line 49 for you is something different.
One thing I notice off the bat is that there's a redundant slash in the file path, so I think we can update the following line inResource\GUI\Component\Image::__set_state(array( 'alt' => NULL, 'src' => Resource\Utility\URL::__set_state(array( 'scheme' => NULL, 'host' => NULL, 'path' => NULL, 'query' => NULL, 'fragment' => NULL, 'url' => 'https://pixellatopia.mysidiahost.com//picuploads/adopt_images/1.png?0', )), 'width' => NULL, 'height' => NULL, 'action' => NULL, 'type' => NULL, 'containers' => array ( ), 'name' => NULL, 'visible' => true, 'align' => NULL, 'font' => NULL, 'foreground' => NULL, 'background' => NULL, 'css' => NULL, 'container' => NULL, 'lineBreak' => false, 'id' => NULL, 'class' => NULL, 'event' => NULL, 'attributes' => ArrayObject::__set_state(array( 'Src' => true, )), 'renderer' => Resource\GUI\Renderer\AccessoryRenderer::__set_state(array( 'tag' => 'img', 'component' => NULL, 'render' => '', 'status' => 'ready', )), ))
When image is opened in new tab I get the error in the screenshot
getImage()
:$home = SCRIPTPATH . '/';
$home = SCRIPTPATH;
__toString()
method. So we'll start with seeing whether we can fix these things when we go to the URLs directly, and work our way from there.picuploadsController
, my guess as to what's happening is that the file doesn't exist, so it's falling back to routing the request through index.php and thus we get the error complaining about the lack of a controller for this subdirectory.picuploadsController
since it looks like Apache handles all of the static assets, like images.picuploads/adopt_images
is a directory, and that the file named 1.png
exists within it?unexpected variable "$composed_image" in /home/pixellat/public_html/controller/main/adoptimagecontroller.php on line 109
__toString()
now - I didn't notice before that your version of myadoptsview.php
was different, but after going back and looking at the attachments again, I noticed it listed there.$adoptImage = new Image("{$ownedAdopt->getImage()}");
getImage()
will now return an instance of Image
:$adoptImage = $ownedAdopt->getImage();
Image
instance is being cast to a string by PHP, because the Image
class implements a method named __toString()
, and the object is interpolated into a string due to being surrounded by double quotes. This conversion is why we see a broken image with the following source in devtools:Changed the myadoptsview.php, but I'm a bit confused on what file I need to change the $home = SCRIPTPATH . '/';One thing I notice off the bat is that there's a redundant slash in the file path, so I think we can update the following line ingetImage()
:
PHP:$home = SCRIPTPATH . '/';
To be$home = SCRIPTPATH;
(At some point we can get rid of this variable altogether now, but just for simplicity's sake while we're troubleshooting, so we only need to change one line, we'll do it like this...)
I'm not sure if this will fix the issue we're seeing on the adoptable manage page yet, because I noticed that instead of the expected image source, it's calling the object's__toString()
method. So we'll start with seeing whether we can fix these things when we go to the URLs directly, and work our way from there.
Now, for the error concerningpicuploadsController
, my guess as to what's happening is that the file doesn't exist, so it's falling back to routing the request through index.php and thus we get the error complaining about the lack of a controller for this subdirectory.
It's expected that we don't have apicuploadsController
since it looks like Apache handles all of the static assets, like images.
Can you confirm whetherpicuploads/adopt_images
is a directory, and that the file named1.png
exists within it?
Secondly there's another error in the other path that I noticed:
Code:unexpected variable "$composed_image" in /home/pixellat/public_html/controller/main/adoptimagecontroller.php on line 109
This specific error seems to be because you're missing semicolons in a few places. For example, at the end of line 107.
I've attached an updated version that adds all the missing semicolons. There may be other errors related to this one, but try replacing that file with the attached version and we can go from there.
That change forChanged the myadoptsview.php, but I'm a bit confused on what file I need to change the $home = SCRIPTPATH . '/';
Also added the updated file.
The markings are labelled as marking1, marking2, etc because I noticed that it was calling the marking1 image for the testing adopt otherwise. It is strange that imagemagick doesn't seem to be running, though.
$home
will be in model/domainmodel/ownedadoptable.php
, specifically in the getImage()
function. Ctrl + F for function getImage
and then find the line that looks like $home = SCRIPTPATH . '/';
, and replace it with the $home = SCRIPTPATH;
version, and you're good to go there.phpinfo.php
with the following code, and let me know when it's up? I want to take a look at your server's PHP config to see if anything stands out re: the Imagemagick extension.<?php phpinfo(); ?>
adoptimage/view
I think we're making progress since now we have the actual page rendering. Judging from the error message, I'm wondering if the above change to the $home
variable won't fix the "Failed to read the file" problem. Assuming that it's using the path that has two slashes (i.e. the one we're about to fix) then I think it's possible.Can you confirm whether picuploads/adopt_images is a directory, and that the file named 1.png exists within it?
picuploads
directory - then if you want you could reply with an attached screenshot, showing what files and folders exist in that directory, to help me narrow down the issue with the picuploads/adopt_images
URLs.Fixed the scriptpath error, but now the image isn't loading at all and is throwing this again: Fatal Error: Class Controller\Main\picuploadsController either does not exist, or has its include path misconfigured!That change for$home
will be inmodel/domainmodel/ownedadoptable.php
, specifically in thegetImage()
function. Ctrl + F forfunction getImage
and then find the line that looks like$home = SCRIPTPATH . '/';
, and replace it with the$home = SCRIPTPATH;
version, and you're good to go there.
The names of the markings should be fine as far as I'm aware, but yeah, it is odd that Imagemagick isn't doing anything. Can you create a file in the directory you uploaded Mysidia into namedphpinfo.php
with the following code, and let me know when it's up? I want to take a look at your server's PHP config to see if anything stands out re: the Imagemagick extension.
PHP:<?php phpinfo(); ?>
edit: Looking atadoptimage/view
I think we're making progress since now we have the actual page rendering. Judging from the error message, I'm wondering if the above change to the$home
variable won't fix the "Failed to read the file" problem. Assuming that it's using the path that has two slashes (i.e. the one we're about to fix) then I think it's possible.
That reminds me - did you see this question in my last post?
You should be able to confirm this by opening your FTP client, or your host's file manager if using something like CPanel, and navigating to thepicuploads
directory - then if you want you could reply with an attached screenshot, showing what files and folders exist in that directory, to help me narrow down the issue with thepicuploads/adopt_images
URLs.
Yeah, I think that's basically what's happening. My guess is that it goes something like this: Apache gets the request forFixed the scriptpath error, but now the image isn't loading at all and is throwing this again: Fatal Error: Class Controller\Main\picuploadsController either does not exist, or has its include path misconfigured!
Also added the phpinfo file.
Attached are the screenshots of adopt_images
edit: maybe the code is throwing the error because it's expecting imagemagick to render 1.png as a file and save it to adopt_images?
picuploads/adopt_images/1.png
and looks for the image file at that path. The file doesn't exist, so Apache goes on to the next request handler specified in the htaccess file, which sends the request to index.php
. Mysidia then attempts to find a controller from the URL and can't, so it throws the error.1.png
. Upload it to picuploads/adopt_images
and let's see if the file loads without that error.3.png
. (Assuming that's what triggers the image rendering process - correct me if I'm mistaken about that.)Yeah it still throws the error even with an image loading. I just remembered I forgot to implement it saving as an image (I think it's on like page one or two) so I can try getting that up and see if it does anything.Yeah, I think that's basically what's happening. My guess is that it goes something like this: Apache gets the request forpicuploads/adopt_images/1.png
and looks for the image file at that path. The file doesn't exist, so Apache goes on to the next request handler specified in the htaccess file, which sends the request toindex.php
. Mysidia then attempts to find a controller from the URL and can't, so it throws the error.
To test this, let's try something: Pick any random PNG and name it1.png
. Upload it topicuploads/adopt_images
and let's see if the file loads without that error.
If it does, then we can attempt to narrow down why the file wasn't created. It's possible that it was due to the filepath misconfiguration from before, in which case, maybe we test a new adoption to see if that creates3.png
. (Assuming that's what triggers the image rendering process - correct me if I'm mistaken about that.)
I'll take a look at the PHP info in the meantime and see if anything stands out re: the extension.