Weird MAMP problem with QuizMaker add-on
Permalink
Anyone use MAMP? For some reason, the image paths for the QuizMaker add-on's dashboard buttons (delete, up, and down icons) are broken when I install it locally via MAMP. As far as I have seen, this is the only thing that is broken and it's the first time such a thing has ever happened to me. The add-on works fine, but the images are missing and show broken image icons instead.
When I installed the add-on remotely, the images work perfectly.
Examining the image path in Web Inspector, I see that QuizMaster is looking for the images in the root htdocs MAMP directory rather than the appropriate Concrete5 installation's packages directory. In other words, it's looking for the images in "localhost:8888/packages" rather than "localhost:8888/c5installation/packages..."
Anyone have any idea why this would be happening? I just dropped the QuizMaker add-on in the C5's packages directory as usual to install it and then installed it through the dashboard. This is exactly what I did remotely by FTP. So, it must be something to do with MAMP, but I don't know why it would just be affecting this add-on and nothing else.
I don't have an .htaccess or site.php file that is doing anything weird to the paths. I tried it on two local C5 installations and one remote installation. Both local C5 installs have broken icon images where the up, down and delete buttons should be in the dashboard when I create a new question with the QuizMaker add-on. The remote install was fine.
The add-on is here if anyone with MAMP wants to see if they can replicate the problem:
http://www.concrete5.org/marketplace/addons/quizmaker/...
You have to go to the dashboard after installation to "Questions" and create a new question, then add a couple Answers. Attached is a screenshot of the broken images so you can get an idea whereabouts the broken images appear...
When I installed the add-on remotely, the images work perfectly.
Examining the image path in Web Inspector, I see that QuizMaster is looking for the images in the root htdocs MAMP directory rather than the appropriate Concrete5 installation's packages directory. In other words, it's looking for the images in "localhost:8888/packages" rather than "localhost:8888/c5installation/packages..."
Anyone have any idea why this would be happening? I just dropped the QuizMaker add-on in the C5's packages directory as usual to install it and then installed it through the dashboard. This is exactly what I did remotely by FTP. So, it must be something to do with MAMP, but I don't know why it would just be affecting this add-on and nothing else.
I don't have an .htaccess or site.php file that is doing anything weird to the paths. I tried it on two local C5 installations and one remote installation. Both local C5 installs have broken icon images where the up, down and delete buttons should be in the dashboard when I create a new question with the QuizMaker add-on. The remote install was fine.
The add-on is here if anyone with MAMP wants to see if they can replicate the problem:
http://www.concrete5.org/marketplace/addons/quizmaker/...
You have to go to the dashboard after installation to "Questions" and create a new question, then add a couple Answers. Attached is a screenshot of the broken images so you can get an idea whereabouts the broken images appear...
PHEW! I have determined it is not just MAMP on my regular machine. I just tried it on the Macbook Pro as well and got the same problem. It must be something about this particular Add-On that doesn't like MAMP. I was worried I somehow broke my MAMP installation before.
The absurd solution I came up with is to just put the full path in the site.php as this:
Since the problem persists when moving a local MAMP site to remote, I just update the path in site.php for the remote site.
Now that you see this solution, is there any way you can think of that would work better with the add-on files rather than sticking this in site.php? Basically the path is just going right to the root directory of MAMP when I install the package rather than the proper packages directory for the particular C5 installation.
define('QUIZPATH_DIR', 'http://localhost:8888/c5installwr14/packages/bd_quiz/single_pages/dashboard/bd_quiz/');
Since the problem persists when moving a local MAMP site to remote, I just update the path in site.php for the remote site.
Now that you see this solution, is there any way you can think of that would work better with the add-on files rather than sticking this in site.php? Basically the path is just going right to the root directory of MAMP when I install the package rather than the proper packages directory for the particular C5 installation.