Hi,

One of the content editors at my workplace had tried to create a context and he had put a slash in as the name. Upon creation of the context, however, he found that he could no longer edit it (it would give him a page not found). What I see is that the context name is passed in as part of the url and my guess would be that since each slash is seen as a separate argument, context does not see it in this case. So it seems that having a check that there are no slashes (or converting the slashes to dashes or something else) seems like a good check to do.

Will post patch once I start looking through the module on this aspect.

Comments

muschpusch’s picture

patch would be great! Until then you can delete / rename the record in context table...

btmash’s picture

StatusFileSize
new81.29 KB

Yep, that is precisely what I did. I'm a bit confused as I try to figure out where the validation takes place. I see the function context_ui_edit_name_validate but didn't see it actually run. Trying to insert a second context with the same name caused a PDOException to occur. Seems like this might be a larger issue?

Attaching pic.

btmash’s picture

Title: Context Name should not contain slashes » Name validation does not run when submit is clicked on adding new context
Priority: Normal » Major
Status: Active » Needs review
StatusFileSize
new960 bytes

Ok, it seems like the error stemmed from the fact that the isset() check on the validation was missing being NOT isset. I also added in the $form parameter that is defined in the forms_api_reference. Patch needs review but from what I see, this now actually performs validation and also gets rid of the pdoexception. Marking at high priority due to the type of bug and behavior on 'duplicate' name.

febbraro’s picture

Status: Needs review » Closed (duplicate)