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

Incidencia - API - Coger nombre interno en lugar de etiqueta del campo al filtrar. #266

Open
PaulaaSTIC opened this issue Jan 17, 2025 · 0 comments
Assignees
Labels
bug Something isn't working SinergiaDA

Comments

@PaulaaSTIC
Copy link
Collaborator

Descripción del Issue

Al incluir un filtro de panel, la consulta está utilizando la etiqueta del desplegable en lugar del nombre interno del campo. Esto genera un problema, ya que si la etiqueta cambia por alguna razón, el filtro dejará de funcionar.

Ejemplo de consultas afectadas:

Consulta actual (basada en la etiqueta):

SELECT `sda_campaigns`.`id` as `ID Campañas`  
FROM sda_campaigns
LEFT JOIN `sda_l_campaigns_status_campaign_status_dom` ON  `sda_campaigns`.`status` = `sda_l_campaigns_status_campaign_status_dom`.`code`  
WHERE  (`sda_l_campaigns_status_campaign_status_dom`.`value`  = 'Completa')  
GROUP BY `sda_campaigns`.`id`;

Se propone utilizar siempre el nombre interno (campo code) en lugar de la etiqueta (campo value). Esto garantizará que los filtros sean robustos ante cambios en las etiquetas del desplegable.

SELECT `sda_campaigns`.`id` as `ID Campañas`  
FROM sda_campaigns
LEFT JOIN `sda_l_campaigns_status_campaign_status_dom` ON  `sda_campaigns`.`status` = `sda_l_campaigns_status_campaign_status_dom`.`code`  
WHERE  (`sda_l_campaigns_status_campaign_status_dom`.`code`  = 'Complete')  
GROUP BY `sda_campaigns`.`id`;

@PaulaaSTIC PaulaaSTIC added bug Something isn't working SinergiaDA labels Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SinergiaDA
Projects
None yet
Development

No branches or pull requests

2 participants