Join Jon Peck for an in-depth discussion in this video Removing a content type, part of Drupal 7 Custom Module Development.
Let's continue with the best practice of leaving a clean slate upon uninstall by removing the …content type that was created. …If I just delete the content type, it doesn't take into account any fields or instances I've added. …So those should be removed cleanly as well. …Finally, if I remove the content type, the existing nodes will be orphaned and will really …mess up functionality. …Therefore, it makes sense to delete those nodes as well. …I'll start by removing the existing content of type windfarm. …To do that I'm going to leverage and Drupal function called node_delete_multiple which …deletes a group of nodes based on array of their node IDs.…
I'll assemble that list using a database query. …One of the features and Drupal 7 is a database abstraction layer which should be leveraged …whenever dealing with user input. …This layer unifies the interactions with different database servers and provides a structured …interface for building queries, providing security, and other best practices. …
- Creating your first module
- Interacting with hooks
- Working with permissions and roles
- Controlling access
- Adding a menu item to an admin interface
- Using the Form API (FAPI) to quickly create a form
- Creating custom form validation
- Manually creating a custom content type
- Validating user input
- Importing content using feeds
- Creating a block
- Understanding best practices and coding standards
Skill Level Advanced
Q: gmap3_tools is not working the way I expected it to. What version of gmap3_tools should I be using?
A: Use the free exercise file containing the version of gmap3_tools used for recording; the published version of the module on drupal.org has changed since recording and is not backwards compatible.
Q: I attempted to run the Drupal site root from the project files, but the site isn't loading. Why not?
A: The Drupal configuration file in sites/default/settings.php contains database configuration specific to the environment used to record the movie. This may be different than your environment. Edit the file and search for "windfarms" - you may need to change the database host, username, password, db name and port to match your specific environment.