buildamodule / Drupal-8-Developer-Prep-Resource-Pack

6 stars 3 forks source link

hook_page_alter() in drupal 8? #1

Open blueShadow opened 9 years ago

blueShadow commented 9 years ago

Hi this code trows an error: "Error The website has encountered an error. Please try again later.Hello, content!" The error the page is blank and Hello, content! is printed after the msg.

Also if i try to print_r($page) inside the hook and it returns a empty array.

blueShadow commented 9 years ago

Note: i'm using drupal-8.0.0-beta3

chrisshattuck commented 9 years ago

Hey! So, you will probably get some errors if you're using the latest version of Drupal 8. To make sure you don't run into errors that stop you from moving forward, you would want to use the version we used in the videos (I think it was alpha 12 or so?). Doing what you're doing is good if you want to see what the differences are between that version and the latest, but you'll have to do some troubleshooting along the way.

Thanks!

MrPhilbert commented 9 years ago

Come on Chris. Since this has not worked for nearly a year would you take this response as acceptable? Have you just given up on this? Subscribed to your videos for quite some time a while ago but this worries me.

chrisshattuck commented 9 years ago

Hey there, thank you for the comment, and good question. The videos in "Drupal 8 Developer Prep" take the viewer through some important concepts in Drupal 8, but its not my goal to continually update the videos themselves to keep them in line with the latest version of Drupal 8's API. Instead, the main focus is on broader topics such as OOP and Symfony, with occasional points where we reference Drupal 8's API. Future collections will be created once Drupal 8 is released (or has a release candidate) that will more closely parallel the final API implementation.

I will continue to add commentary (called 'video updates' on the site) to indicate when there have been departures between the Drupal 8 version used in the videos and the latest version, but the vast majority of the collection is still very relevant and shouldn't trip you up as long as you use the specific release we use in the videos.

Thank you for your patience, and I hope this helps with the worry. If you have any other questions or worries, please just let me know!