[BUG]: can't create link using dynamic get of type getCustoms, custom code is not added just before "return $items;" #1224
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What Happened?
I created a dynamic get of type getCustoms, in it I added code in the custom script -> Add PHP (after getting the Items) section.
After compiling the component I expected getCustoms to work like getListQuery and add the custom script just before "return $items;" , but it wasn't.
Steps to reproduce the Bug
Which Joomla version are you compiling in?
5.3.0
Which PHP version are you compiling in?
8.2.23
Which Joomla versions are you targeting?
v5.x
Which PHP version are you targeting?
8.x
Which Web server is JCB running on?
Apache/2.4.62 (Debian)
Which Relational Database is JCB running on?
Mysql, 11.6.2-MariaDB-ubu2404
Which OS is JCB running on?
Ubuntu
Which JCB version are you using?
v5.1.1-alpha5
Where in JCB did this issue occur?
Dynamic Get(admin_view)
On which browsers did you encounter the issue?
Firefox
Additional Comments
[BUG]:to [BUG]: dynamic get of type getCustoms do not add the custom code just before "return $items;"[BUG]: dynamic get of type getCustoms do not add the custom code just before "return $items;"to [BUG]: can't create slug using dynamic get of type getCustoms, custom code is not added just before "return $items;"Give us some screen shots of each tab you are using in the Dynamic get area... so I can explain to you what you can do to get the expected outcome,
Is not a real problem for me right now, I just need to move that piece of custom script a little bit down every time I compile the app.
If this is how it should work, there is no problem, except that in the normal dynamicGet, the custom script is placed just before
return $items;
, I just assumed that this should be the case in getCustoms as well.Because the slug is created a little bit down, I can't use it in my custom script.
[BUG]: can't create slug using dynamic get of type getCustoms, custom code is not added just before "return $items;"to [BUG]: can't create link using dynamic get of type getCustoms, custom code is not added just before "return $items;"hmmm lets fix this for you... and we can investigate this to see if this change will work for everyone.
So first... in the crazy file: Interpretation
We replace line 3705-3727 with:
This should fix the issue for you.
This moves the code that is in the
php_after_getitems
to be below the auto generated loop. Ideal would be that we can in the loop add our code actually. So I will add this to the possible improvement towards the next release. For now this fix should help you, but we might need to do more here, and so you might have to refactor this again with the next stable release.It is working.