- Posts: 2
COMMUNITY FORUM
Bug in Item field type
- Artur Stępień
-
Topic Author
- Offline
- New Member
/administrator/components/com_k2/elements/item.php
Screen (look at what button I do click):
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Is this view a part of Joomla! or a 3rd party extension?
Please Log in or Create an account to join the conversation.
- Artur Stępień
-
Topic Author
- Offline
- New Member
- Posts: 2
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
- Posts: 8743
The fact that this field supports only one instance is not considered a bug. It was designed like that according to the needs.
Since you are developing your own module, you have to create a field on your own to handle that.
Please Log in or Create an account to join the conversation.
- Olivier Buisard
-
- Offline
- New Member
- Posts: 6
I am having the same issue.
Creating my own 'item' custom field is easy, but the problem seems to come from the modal view used by the field (the return value is sent to the last field on the page).
It would actually be 'nice' for the K2 team to improve on the modal view in order to allow re-use of the code (like it is done in the Joomla! core for the 'article' custom field).
This is one huge limitation of the K2 'item' custom field in my opinion.
Please Log in or Create an account to join the conversation.
- Olivier Buisard
-
- Offline
- New Member
- Posts: 6
For anyone interested in the custom field 'k2item' I have created in replacement for the original one, please contact me here and I will be happy to share :-)
Please Log in or Create an account to join the conversation.
- Olivier Buisard
-
- Offline
- New Member
- Posts: 6
'object' (which is in the request) is lost when paginating through items (actually, any time there is a refresh in the modal window), resulting in the item selected not being picked up when properly coding an 'item' custom field to allow for multiple occurrences on a page. When there is just one 'item' custom field (original from core K2), the bug gets unnoticed (since 'object' is never used in jSelectItem of the 'item' custom field).
Adding to the form of the view:
<input type="hidden" name="object" value="<?php echo JRequest::getCmd('object', 'id'); ?>" />
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Can you make a PR at github.com/getk2/k2
Please Log in or Create an account to join the conversation.
- Olivier Buisard
-
- Offline
- New Member
- Posts: 6
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- Olivier Buisard
-
- Offline
- New Member
- Posts: 6
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- Olivier Buisard
-
- Offline
- New Member
- Posts: 6
Please Log in or Create an account to join the conversation.