Model Relationships: typo in example code
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- Menos de una hora
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Documentación
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- php
- Área
- documentation
Línea de trabajo
Read the model relationships section linked in the issue and compare its examples with the EE6 relationship definition described here. The issue reports that adding the ee: prefix to the model name fixes an unknown-model error, but asks for confirmation that this is a documentation bug. Done means verifying the behavior and correcting the examples if confirmed.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description of the problem
In the description of model relationships there are several examples of code used to define relationships between models. The examples all have the same basic core that looks something like this:
protected static $_relationships = array(
'Author' => array(
'model' => 'Member',
'type' => 'BelongsTo'
)
);
For EE6 at least this construct appears to be incorrect, as using this type of construct omits the ee: prefix and (at least in this authors test system) without this prefix EE will reject the relationship throwing an error of the form:
Unknown model "Member". Used in model "myAddon:Model" for a relationship called "Reln".
Adding the ee: prefix eliminates the error and leads to normal operation.
protected static $_relationships = array(
'Author' => array(
'model' => 'ee:Member',
'type' => 'BelongsTo'
)
);
However it may be that this is an issue unique to my system, so I would value observations about whether or not this is indeed a documentation bug.
If it is indeed a bug I'm happy to amend the documentation as required.
Additional context
The ee: prefix is used in relationship definitions within the EE code (e.g. in Addons\Forum\Model\Administrator.php).
- Lenguaje dominante
- CSS
- Estrellas
- 22
- Forks
- 79
- Merge medio
- 2 d 1 h
- PR fusionados (30 d)
- 6
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
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 ExpressionEngine/ExpressionEngine-User-Guide
-
Inconsistent code block spacingAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
-
registration form docsAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 55/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 45/100
-
Clarify autosave interval valueAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 55/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 46/100
Todos los issues de ExpressionEngine/ExpressionEngine-User-Guide
Issues similares
-
Cleanup SetupPosiblemente ocupada @AlexanderKaran la tomó hoy. Abiertodocumentation enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
e18e/framework-tracker#769 ·
Los mantenedores suelen responder en 1 día
-
fix(docker): correct stale --db-path comments in fetch/git Dockerfiles and clarify git READMEAbiertobug v2
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
modelcontextprotocol/servers#5483 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
simonw/sqlite-utils#928 ·
Los mantenedores suelen responder en 3 días
-
agentic-workflows automation repo-assist
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
shanselman/winget-tui#483 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
griptape-ai/griptape-nodes-library-elevenlabs#30 ·
Los mantenedores suelen responder en 1 día