Namespace restriction for source= queries is inert: smwAskParserFunction/smwShowParserFunction hooks do not exist
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 45/100
Línea de trabajo
Comienza en src/HookRegistry.php e inspecciona los handlers registrados smwAskParserFunction y smwShowParserFunction. Comprueba si un hook compatible de Semantic MediaWiki puede inspeccionar o sobrescribir las llamadas #ask y #show, y después revisa HookRegistryTest.php. Se considera terminado cuando la restricción de namespace funciona mediante una ruta compatible, o cuando se actualizan los handlers sin uso y la documentación, con cobertura de regresión.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
HookRegistry registers handlers for two hook names — smwAskParserFunction and smwShowParserFunction — that do not exist in Semantic MediaWiki. As a result, the feature they implement (restricting source= queries to $seqlgExternalQueryEnabledNamespaces) never runs.
Details
src/HookRegistry.php registers a handler under both names:
$this->handlers['smwAskParserFunction'] = $this->handlers['smwShowParserFunction'] = static function ( $parser, $frame, $args, &$override ) {
// ... sets:
// $override = 'Warning: source parameter is not allowed in the namespace!'
// when the page's namespace is not in $GLOBALS['seqlgExternalQueryEnabledNamespaces']
};
This only does anything if Semantic MediaWiki fires hooks literally named smwAskParserFunction / smwShowParserFunction. Those names appear nowhere in the Semantic MediaWiki source tree, nor anywhere in its Git history, so the handlers are never invoked. The #ask / #show execution path (AskParserFunction / ShowParserFunction) does not run a hook of that name.
Impact
The $seqlgExternalQueryEnabledNamespaces namespace restriction is silently inert: a {{#ask: … |source=… }} (or {{#show:}}) query is not blocked in disallowed namespaces, contrary to what the setting documents.
This is pre-existing (identical on the current released code and on the SMW 7.0 branch) and was discovered during the SMW 7.0 migration (#44). The test suite does not catch it because HookRegistryTest only asserts the InterwikiLoadPrefix handler is registered, not that the ask/show guard fires.
Suggested next steps
- Confirm whether Semantic MediaWiki exposes an equivalent hook in a supported version that allows inspecting/overriding
#ask/#showparser-function invocations, and rewire the namespace guard to it; or - If no such hook exists, remove the dead handlers and either implement the namespace restriction by another mechanism or update the
$seqlgExternalQueryEnabledNamespacesdocumentation accordingly. - Add test coverage for whichever path is chosen so the guard cannot silently regress again.
- Lenguaje dominante
- PHP
- Estrellas
- 9
- Forks
- 8
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de SemanticMediaWiki/SemanticExternalQueryLookup
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
-
Not working with SMW 4.xAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
SemanticMediaWiki/SemanticExternalQueryLookup#33 · 1 comentario · 1 reacción ·
-
Use with private wikisAbiertoenhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
SemanticMediaWiki/SemanticExternalQueryLookup#28 · 6 comentarios ·
Todos los issues de SemanticMediaWiki/SemanticExternalQueryLookup
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
components-web-app/api-components-bundle#403 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
mollie/PrestaShop#1566 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
components-web-app/docs#193 ·
-
docs: add Python and PHP examples to docs/api.mdPosiblemente ocupada @gaurika-analyst la tomó hoy. Abiertodocumentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
djazairdev/wilayas#12 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Deno Runtime is discontinuedAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
endoflife-date/endoflife.date#11314 ·
Los mantenedores suelen responder en 1 día