Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMister Moody
48,333 PointsInterface Implodes during Testing
Having troubles understanding how the entire site fell apart after I began testing interfaces. Once I updated the list.php, share.php, track.php, single.php
files, details from the database.json
file were omitted and the function that allowed single-items to expand no longer functioned as constructed.
I deleted all new code for this particular video, and everything worked fine. Because I included my own CSS I will review <html> tag
placement to ascertain if that could be the culprit, but this is one of those 'f*#$' me moments where I have double-checked typos and rewatched the entire series only to realize that I'm in big trouble.
You can view a snapshot of the project for analysis.
Thank you in advance.
1 Answer
Ben Payne
1,464 PointsHey Mister Moody - Have a look at views/track.php
line 3:
<?php echo $content-getAuthor(); ?>
Also, take a look at src\classes\jsonRepository
line 23:
<?php
//
public function find($entity, $value, $field = 'id')
{/* LOOP through json File Items */
foreach ($this->all($entity) as $key=>$data) {
/* LOAD 'json' File */
if ($data->field == $value) { // THIS LINE IS MISSING AN IMPORTANT CHARACTER ;)
return array($data);
}
}
}
Hopefully that helps.
Cheers,
Ben
Mister Moody
48,333 PointsThank you for your assistance Ben. That single omission of the >
character was indeed the culprit, and all systems are functioning as intended! I have different working copies for this project; one using the teachers CSS and one where I am implementing my own styles that incorporates a grid layout and it is causing me some fuss, but all is good in my world for the weekend thanks to your help!
KRIS NIKOLAISEN
54,971 PointsKRIS NIKOLAISEN
54,971 PointsYour snapshot is missing a colon after https
https://w.trhou.se/1n5y29pmxa