Closed garstud closed 2 months ago
Hi @garstud , Thank you very much for your report!! It looks as I forgot something in the code. Let me check it and I will come back with a fix.
Happy new year!!
Hi @garstud , I have noticed I didn't reply to this.
I have just pushed a fix for this at: https://github.com/PacktPublishing/Developing-Extensions-for-Joomla-5/commit/3c5c88dce49a03cead1576a5e1a4c58f5b97d5c9
Thanks!!
Hello @carcam , Thank you for your awesome work on this book.
When trying to execute com_spm with the Router, i found a "Notice" (in local dev) on the Router link of a project.
How to reproduce
<a href="/<br /> <b>Notice</b>: Undefined variable: id in <b>C:\laragon\www\joomla42\components\com_spm\src\Service\Router.php</b> on line <b>38</b><br /> <br /> <b>Notice</b>: Undefined variable: id in <b>C:\laragon\www\joomla42\components\com_spm\src\Service\Router.php</b> on line <b>38</b><br /> /index.php/spm-projects/sit-quod">sit quod</a>
Solution
In the /src/Service/Router.php in line 38 : Replace:
$id = (int) $id;
with:$key = (int) $key;