Background:
I ran across this issue while attempting to add the Optimizely JS snippet on a form completion landing page. The landing page was built via a custom module, and the path defined by the hook_menu required an argument. I then reviewed the issue queue to find no related issues, which inspired the creation of this new issue.

Steps to Reproduce:
As an administrator, when attempting to save a project that requires adding the Optimizely Code Snippet to a path that is defined by a hook_menu in a custom module; you will receive a form validation error error:

"The project path "!project_path" is not a valid path. The path or alias could not be resolved as a valid URL that will result in content on the site."

To resolve this issue, we can add a new function to also check for paths defined via hook_menu in custom modules. We will also need to update the conditional validation logic to also check for custom paths.

Comments

wjackson created an issue. See original summary.

wjackson’s picture

Status: Active » Needs review
StatusFileSize
new1.58 KB

This patch includes the changes to resolve this issue. The logic could also be included within _optimizely_valid_paths(), however this patch will add the logic as a separate function.