<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0">
I updated the snippet parameterAsEnumString return an empty value.</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>De :</b> QGIS-Developer <qgis-developer-bounces@lists.osgeo.org> de la part de Nicolas Godet via QGIS-Developer <qgis-developer@lists.osgeo.org><br>
<b>Envoyé :</b> vendredi 24 février 2023 14:11<br>
<b>À :</b> qgis-developer@lists.osgeo.org <qgis-developer@lists.osgeo.org><br>
<b>Objet :</b> [QGIS-Developer] parameterAsEnumStrings always return default value</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div class="x_elementToProof x_ContentPasted0" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Dear devs, </div>
<div class="x_elementToProof x_ContentPasted0" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div class="x_elementToProof x_ContentPasted0 x_ContentPasted1" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
I noticed in a custom alg that `parameterAsEnumStrings` always return the default value set in QgsProcessingParameterEnum.</div>
<div class="x_elementToProof x_ContentPasted0 x_ContentPasted1" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Below a example alg to reproduce.</div>
<div class="x_elementToProof x_ContentPasted0 x_ContentPasted1" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div class="x_elementToProof x_ContentPasted0 x_ContentPasted1" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
i prefere to start with an email before raising an issue as I could miss something</div>
<div class="x_elementToProof x_ContentPasted0 x_ContentPasted1" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div class="x_elementToProof x_ContentPasted0 x_ContentPasted1" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
In alg window select any value different from 2023 (ex: 2020, index 3 in list).</div>
<div class="x_elementToProof x_ContentPasted0 x_ContentPasted1" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Run alg</div>
<div class="x_elementToProof x_ContentPasted0 x_ContentPasted1" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
See info in log:</div>
<div class="x_elementToProof x_ContentPasted0 x_ContentPasted1" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div class="x_elementToProof x_ContentPasted0 x_ContentPasted1" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
"""</div>
<div class="x_elementToProof x_ContentPasted0 x_ContentPasted1" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<span class="x_ContentPasted2" style="color:#777777">Version de QGIS : 3.28.3-Firenze</span>
<p class="x_ContentPasted2"></p>
<p style="margin-top:0px; margin-bottom:0px"><span class="x_ContentPasted2" style="color:#777777">Révision du code : c12bcb2f76c</span></p>
<p style="margin-top:0px; margin-bottom:0px"><span class="x_ContentPasted2" style="color:#777777">Version de Qt : 5.15.3</span></p>
<p style="margin-top:0px; margin-bottom:0px"><span class="x_ContentPasted2" style="color:#777777">Version de Python : 3.9.5</span></p>
<p style="margin-top:0px; margin-bottom:0px"><span class="x_ContentPasted2" style="color:#777777">Version de GDAL : 3.6.2</span></p>
<p style="margin-top:0px; margin-bottom:0px"><span class="x_ContentPasted2" style="color:#777777">Version de GEOS : 3.11.1-CAPI-1.17.1</span></p>
<p style="margin-top:0px; margin-bottom:0px"><span class="x_ContentPasted2" style="color:#777777">Version de Proj : Rel. 9.1.1, December 1st, 2022</span></p>
<p style="margin-top:0px; margin-bottom:0px"><span class="x_ContentPasted2" style="color:#777777">Version de PDAL : 2.4.3 (git-version: f8d673)</span></p>
<p class="x_ContentPasted2" style="margin-top:0px; margin-bottom:0px">Algorithme commencé à: 2023-02-24T14:10:09</p>
<p style="margin-top:0px; margin-bottom:0px"><span class="x_ContentPasted2" style="font-weight:600">Démarrage de l'algorithme 'debug'…</span></p>
<p class="x_ContentPasted2" style="margin-top:0px; margin-bottom:0px">Paramètres en entrée:</p>
<p style="margin-top:0px; margin-bottom:0px"><span class="x_ContentPasted2" style="font-family:'Courier New'">{ 'PARAMNAME' : 3 }</span></p>
<p style="margin-top:0px; margin-bottom:0px"><br class="x_ContentPasted2">
</p>
<p class="x_ContentPasted2" style="margin-top:0px; margin-bottom:0px">['2023', '2022', '2021', '2020']</p>
<p class="x_ContentPasted2" style="margin-top:0px; margin-bottom:0px">[3]</p>
<p class="x_ContentPasted2" style="margin-top:0px; margin-bottom:0px">2023</p>
<p class="x_ContentPasted2" style="margin-top:0px; margin-bottom:0px">Execution completed in 0.02 secondes</p>
<p class="x_ContentPasted2" style="margin-top:0px; margin-bottom:0px">Résultats :</p>
<p style="margin-top:0px; margin-bottom:0px"><span class="x_ContentPasted2" style="font-family:'Courier New'">{}</span></p>
<p style="margin-top:0px; margin-bottom:0px"><br class="x_ContentPasted2">
</p>
<p class="x_ContentPasted2" style="margin-top:0px; margin-bottom:0px">Chargement des couches de résultat</p>
<p class="x_ContentPasted2" style="margin-top:0px; margin-bottom:0px">Algorithme 'debug' terminé</p>
"""</div>
<div class="x_elementToProof x_ContentPasted0 x_ContentPasted1" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div class="x_elementToProof x_ContentPasted0 x_ContentPasted1" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Regards, </div>
<div class="x_elementToProof x_ContentPasted0" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div class="x_elementToProof x_ContentPasted0" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<a href="https://gitlab.nicodet.fr/-/snippets/10" id="LPlnkOWALinkPreview" class="x_elementToProof">https://gitlab.nicodet.fr/-/snippets/10</a><br>
</div>
<div class="x__Entity x__EType_OWALinkPreview x__EId_OWALinkPreview x__EReadonly_1">
<div id="LPBorder_GTaHR0cHM6Ly9naXRsYWIubmljb2RldC5mci8tL3NuaXBwZXRzLzEw" class="x_LPBorder870730" style="width:100%; margin-top:16px; margin-bottom:16px; max-width:800px; min-width:424px">
<table id="LPContainer870730" role="presentation" style="padding:12px 36px 12px 12px; width:100%; border-width:1px; border-style:solid; border-color:rgb(200,200,200); border-radius:2px">
<tbody>
<tr valign="top" style="border-spacing:0px">
<td>
<div id="LPImageContainer870730" style="margin-right:12px; height:160px; overflow:hidden">
<a target="_blank" id="LPImageAnchor870730" href="https://gitlab.nicodet.fr/-/snippets/10"><img id="LPThumbnailImageId870730" alt="" height="160" width="160" style="display:block" src="https://gitlab.nicodet.fr/assets/twitter_card-570ddb06edf56a2312253c5872489847a0f385112ddbcd71ccfa1570febab5d2.jpg"></a></div>
</td>
<td style="width:100%">
<div id="LPTitle870730" style="font-size:21px; font-weight:300; margin-right:8px; font-family:wf_segoe-ui_light,"Segoe UI Light","Segoe WP Light","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; margin-bottom:12px">
<a target="_blank" id="LPUrlAnchor870730" href="https://gitlab.nicodet.fr/-/snippets/10" style="text-decoration:none">Script debug parameterAsEnumStrings ($10) · Snippets · Snippets · GitLab</a></div>
<div id="LPDescription870730" style="font-size:14px; max-height:100px; color:rgb(102,102,102); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; margin-bottom:12px; margin-right:8px; overflow:hidden">
GitLab Community Edition</div>
<div id="LPMetadata870730" style="font-size:14px; font-weight:400; color:rgb(166,166,166); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif">
gitlab.nicodet.fr</div>
</td>
</tr>
</tbody>
</table>
<div id="LPCloseButtonContainer870730" class="x_uHkAz" tabindex="0" title="Supprimer l’aperçu du lien" role="button">
<i data-icon-name="Cancel" aria-hidden="true" id="LPCloseButton870730" class="x_Rm9Q1 x_root-292"></i></div>
</div>
</div>
<br>
</div>
</body>
</html>