- Posts: 17
COMMUNITY FORUM
Image extra field not empty once value is deleted
- Tim
-
Topic Author
- Offline
- New Member
getk2.org/community/New-to-K2-Ask-here-first/162398-SOLVED-Hide-extra-field-if-empty#168586
, which was resolved by upgrading to 2.6.3. I suspect this solved the initial issue, but not if someone has placed a value in the field and then removed it.
I've tried a few variations of the following code to no avail - I don't think the code is the problem here.
Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
I have tested this in a default joomla 2.5.17 and K2 installation SVN 2.6.8 and didn't get an empty image.
Try to change your code to
<?php if(isset($this->item->extraFields->ListingImage) && !empty($this->item->extraFields->ListingImage->value)) : ?>
Please Log in or Create an account to join the conversation.
- Tim
-
Topic Author
- Offline
- New Member
- Posts: 17
I tried that code and also tested on Joomla 2.5.17 and K2.6.7 with no luck.
I do have two possible workarounds. One is similar to Steven's in the afore mentioned thread:
Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
Please Log in or Create an account to join the conversation.
- Tim
-
Topic Author
- Offline
- New Member
- Posts: 17
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
You can sent me access through the contact form here: getk2.org/contact-us
Please Log in or Create an account to join the conversation.
- Tim
-
Topic Author
- Offline
- New Member
- Posts: 17
Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
PS. Don't forget to take a full site backup first.
It is very strange and I have as well tested this in a Joomla! 2.5.17 and K2 2.6.7 and didn't get an empty image.
Have you made any other modifications in core K2 files?
Please Log in or Create an account to join the conversation.
- Tim
-
Topic Author
- Offline
- New Member
- Posts: 17
I haven't modified any core files, only created a few template overrides.
The only other thing that is related is that earlier on in the build I installed k2fields from jproven.com/k2fields
This was to allow the client to repeat extra fields while editing the item, although I later uninstalled it as it didn't suit my purpose.
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
Your URL/index.php?option=com_k2&view=itemlist&layout=category&task=category&id=10&Itemid=191
and this one:
Your URL/whats-on/2013-12-06-04-39-51/shows/itemlist/filter?moduleId=133&Itemid=191
What extension/plugin do you use in order to fetch the second view? I see that the url is different. It has extra parameters set on it.
Please Log in or Create an account to join the conversation.
- Tim
-
Topic Author
- Offline
- New Member
- Posts: 17
The first URL is the straight listings, ordered by default ordering.
The second URL is the listings once the filter has been applied, effectively ordering them by the date extra field.
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
How can you get this view without the filtering enabled, only pure K2 view?
Please Log in or Create an account to join the conversation.
- Tim
-
Topic Author
- Offline
- New Member
- Posts: 17
So I'm guessing this is a bug with the filter then?
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
How is it that you see an image when the filters are not used since the actual extra field is empty? Do you have a condition that checks whether or not to use the image extra field depending on the view?
Please Log in or Create an account to join the conversation.
- Tim
-
Topic Author
- Offline
- New Member
- Posts: 17
Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Moderator
- Posts: 8743
Just tested with K2 2.6.8 DEV build and Joomla! 2.5.18 and i had no issues. No template overrides at all. This means that probably you need to check again your code. If you are not sure how to manipulate extra fields you are recommended to use the default code in the templates for rendering. Also ensure that you do have deleted the value completed and you have not left any spaces to the field.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Tim
-
Topic Author
- Offline
- New Member
- Posts: 17
Please Log in or Create an account to join the conversation.