Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the docblock for layout_suppress() #6754

Open
indigoxela opened this issue Nov 18, 2024 · 0 comments
Open

Fix the docblock for layout_suppress() #6754

indigoxela opened this issue Nov 18, 2024 · 0 comments

Comments

@indigoxela
Copy link
Member

Description of the bug

This docblock is extremely misleading:

/**
 * Suppress the layout.
 *
 * This function should be called from within another module's page callback
 * when the layout should not be displayed, that is, content only. This can be
 * useful for modules that implement popup pages or other special pages where
 * the default layout would be distracting.
 *
 * @param bool $suppress
 *   If set to TRUE, the layout will be suppressed.
 *
 * @return bool
 *   TRUE if the layout can be suppressed, FALSE otherwise.
 *
 * @since 1.21.0 Function added.
 */

That's wrong. Calling layout_suppress inside a page callback does nothing.

Instead, it's necessary to use something like hook_init(), checking for the path, and calling layout_suppress() on desired paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant