Skip to content

Protected Node's features port

Original port discussion happened in this issue #3243484: [1.0.x] Roadmap: Drupal 9 port of Protected Node.

Database table

From custom table to field storage:

  • nid => removed (automatically handled by the field API)
  • protected_node_is_protected => is_protected
  • protected_node_show_title => show_title
  • protected_node_hint => hint
  • protected_node_passwd => password
  • protected_node_passwd_changed => removed
  • protected_node_emails => removed

Configuration

Global configuration

  • Reports => removed
  • Global password => preserved
  • Password inheritance/behavior => field instance setting
  • Show password strength => removed (forced enabled)
  • Show node titles by default => field widget setting
  • Allow author to enter a password hint => field widget setting
  • Protected Node email support => removed
  • Generate a random password if necessary => field widget setting
  • Protected Node form
    • Always add a cancel link => removed
    • other settings => field label / field formatter / view mode usage
  • Display Suite view modes => field instance setting
  • Protected Node actions
    • Clear sessions => removed
    • other actions => use Views Bulk Edit to make your customized admin views

Per bundle configuration

  • Protected mode for nodes of this type => field instance default value / field widget setting
  • A default (global) password for nodes of this type => field instance setting
  • How to show the protected node fieldset => field widget setting

Behavior

Detection if a content entity is protected and if its title should be displayed is now managed only by the field value, no more configuration option that would override field values.

Other features

  • Private attachment support => preserved with support of Webform submissions by default.
    • By default if the user has access to at least one content listed in the file usage of a file, user has access otherwise no access.
    • In the case of Webform submissions, if the Webform submission is attached to an entity, it is the access to this entity that is checked.
    • You can implement an event subscriber to alter and add your desired behavior.
  • Token support => only one token [ENTITY_TYPE:protected-label] (for the show title feature)
  • Flood support => preserved (using the user flood settings)
  • Autocomplete disabled => preserved (by default with Drupal core)
  • Fork => removed
  • Rules submodule => removed
  • Views submodule => removed (no more needed as the module is field based)
  • Search support (hiding info on indexation) => you can configure your view modes as you want and index the fields you want with Search API, so you can index fields to have search results and choose how to display them in other view mode, protected or not. To exclude protected entities from a Search API index, enable the "Exclude password protected entities" processor and select the view modes to check per entity type.