- Posts: 72
COMMUNITY FORUM
Extra Fields Value NULL
- quebecguitare
- Topic Author
- Offline
- Senior Member
I've been working with Gavick's support but we couldn't find the data of these fields on the database:
www.gavick.com/forums/university-joomla3/k2-layout-category-item-extra-field-42956
Here is the latest post from Gavick:
I've tried with this code, but it has the same problem I was talking about before. Extra fields are not picked from database for this. I've checked dump for the whole item and the only place it's used is in search fields. Here is an image with the content of extra fields when the regular K2 display is used. As You see only 3 elements are there and all the rest is presented in dump as NULL.
This must be codded somewhere deeper in core K2 functions. I think K2 developers will be more suitable here to help.
With a dump we could only retrieve these values:
(We are looking for the Extra Field 13 value, named "Résumé" / Alias: coursresume)
object(stdClass)#974 (8) {
["id"]=>
string(2) "13"
["name"]=>
string(8) "Résumé"
["value"]=>
NULL
["type"]=>
string(8) "textarea"
["group"]=>
string(1) "2"
["published"]=>
string(1) "1"
["ordering"]=>
string(1) "3"
["alias"]=>
string(11) "coursresume"
}
[3]=>
Here is the code used in category_item.php:
<?php $extrafields = array(); ?>
<?php if( is_array( $item->extra_fields ) ): ?>
<?php //convertArray to use ids as key
foreach($item->extra_fields as $extraFlds){
$extrafields[$extraFlds->id] = $extraFlds->value;
}
?>
<?php endif; ?>
<?php if ($this->item->params->get('catItemTitleLinked')): ?>
<a href="<?php echo $this->item->link; ?>"><?php echo $this->item->title; ?></a></br>
<?php if($extrafields[13]): ?>
<a href="<?php echo $this->item->link; ?>"><?php echo $extrafields[13]; ?></a>
<?php endif; ?>
<?php else: ?>
<?php echo $this->item->title; ?>
<?php endif; ?>
Maybe I am doing something wrong?
These are my extra field, they are used for the template Suivi_K2:
Nom Groupe Type Publié(e) Id
Avatar du Prof
Alias: AvatarProf Suivi en ligne - K2 Image 9
Date du Cours
Alias: DateduCours Suivi en ligne - K2 Date 10
Résumé
Alias: coursresume Suivi en ligne - K2 Zone de texte 13
Théorie vue
Alias: Thorievue Suivi en ligne - K2 Zone de texte 12
Technique vue
Alias: Techniquevue Suivi en ligne - K2 Zone de texte 14
Répertoire
Alias: Repertoireauprogramme Suivi en ligne - K2 Zone de texte 15
Livre ou lecture
Alias: Livre Suivi en ligne - K2 Champ Texte 16
Écoute suggérée
Alias: disco Suivi en ligne - K2 Champ Texte 17
Lien Vidéo
Alias: video Suivi en ligne - K2 Lien 18
Paiement
Alias: paiement Suivi en ligne - K2 Options 19
Note
Alias: note Suivi en ligne - K2 Zone de texte 20
This is one of the category with the template Suivi_K2 assigned:
www.quebecguitare.ca/suivi/guyla ... -m-quebec/
This is one K2 Item under that category with the extra_field_13 that contains a value:
www.quebecguitare.ca/suivi/guylaine/cours-de-guitare-classique-de-mathis-m-quebec-1
--The ExtraField13 is named "Résumé" and within this K2 Item contains the following value that we should see in the header of the category_item layout: "Bonjour Lucie, voici le Suivi pour le cours de cette semaine. On a pratiqué les pièces pour le concert. Ça va bien aller, Mathis a très bien pratiqué.
J'ai remarqué que Mathis est maintenant capable de jouer plus fort. C'est très bien. Bravo Mathis!!"
Link site / section: www.quebecguitare.ca/suivi/
Thank you,
Regards
Thank you for your time!
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
- Posts: 15920
The category item's template required $this->item. eg:
<?php foreach ($this->item->extra_fields as $key=>$extraField): ?>
You can also try to render a specific extrafield like this:
$this->item->extraFields->EXTRAFIELDALIASHERE->name
$this->item->extraFields->EXTRAFIELDALIASHERE->value
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- quebecguitare
- Topic Author
- Offline
- Senior Member
- Posts: 72
Here is the reply I had from my support at Gavick (I am a developer but not a programmer):
Yes we have tried that but it was not working ;/ It lists extrafields but from unknown reasons the value for extrafield with id 13 is NULL. But the other method is something new. I do not recall this values from a dump, but K2 developers must know better. It's their code :)
Ref.: www.gavick.com/forums/university-joomla3/k2-layout-category-item-extra-field-42956?p=217279#p217279
Krikor: Could I give you login access to this site in private message?
Do you have any comments?
Thank you,
Regards
Thank you for your time!
Please Log in or Create an account to join the conversation.
- Lefteris
- Offline
- Moderator
- Posts: 8743
Does the specific extra field contain value? Do you see it's value when you edit the item in the administration? Finally note that extra fields are also parsing content plugins, so you might need to disable for a while some of them to detect the issue.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- quebecguitare
- Topic Author
- Offline
- Senior Member
- Posts: 72
Does the specific extra field contain value?
-Yes
Do you see it's value when you edit the item in the administration?
-Yes
Thank you.
Regards
Thank you for your time!
Please Log in or Create an account to join the conversation.
- Lefteris
- Offline
- Moderator
- Posts: 8743
1. Use a different template to see if the issue is only related with your current template. You can also call the page by appending "?template=system" to the URL.
2. If the above does not work try to disable some content plugins as i already wrote.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- quebecguitare
- Topic Author
- Offline
- Senior Member
- Posts: 72
I cannot retrieve K2 Extra Fields in the Category_Item View. It returns NULL.
1. We have tried on another template and it doesn't work. So it's not the template.
2. Which plugin would you suggest to disable?
Would it be possible to have somebody looking at my site for this with login info and FTP access?
I am not a developper, I am bit frustrated here.
Ref.: www.quebecguitare.ca/professeurs
Thank you
Regards
Thank you for your time!
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
- Posts: 15920
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- quebecguitare
- Topic Author
- Offline
- Senior Member
- Posts: 72
Nom Emplacement Statut Type Version Date Auteur Dossier ID
Canonical Links for K2
Site Plug-in 3.6.0 July 2014 Marko Dedovic k2 10197
French (France) language pack for K2
Site Fichier 2.5.0 October 23, 2014 getk2.org N/A 10131
Josetta - K2 Categories
Site Plug-in 2.6.9 December 8th, 2014 JoomlaWorks josetta_ext 10286
Josetta - K2 Items
Site Plug-in 2.6.9 June 7th, 2012 JoomlaWorks josetta_ext 10287
K2
Administration Composant 2.6.9 December 8th, 2014 JoomlaWorks N/A 10021
K2 Comments
Site Module 2.6.9 December 8th, 2014 JoomlaWorks N/A 10009
K2 Content
Site Module 2.6.9 December 8th, 2014 JoomlaWorks N/A 10010
K2 Integration- My Maps Location
Site Plug-in 2.2.8 December 2012 Joomunited k2 10333
K2 Login
Site Module N/A 10011
K2 My Maps location
Site Module 2.2.8 December 2012 JoomUnited N/A 10326
K2 Quick Icons (admin)
Administration Module 2.6.9 December 8th, 2014 JoomlaWorks N/A 10015
K2 Stats (admin)
Administration Module 2.6.9 December 8th, 2014 JoomlaWorks N/A 10016
K2 Tools
Site Module 2.6.9 December 8th, 2014 JoomlaWorks N/A 10012
K2 User
Site Module 2.6.9 December 8th, 2014 JoomlaWorks N/A 10014
K2 Users
Site Module 2.6.9 December 8th, 2014 JoomlaWorks N/A 10013
Recherche intelligente - K2
Site Plug-in 2.6.9 December 8th, 2014 JoomlaWorks finder 10017
Search - K2
Site Plug-in 2.6.9 December 8th, 2014 JoomlaWorks search 10018
System - AutotweetK2
Site Plug-in 7.7.0 October 2009 Extly.com system 10145
System - K2
Site Plug-in 2.6.9 December 8th, 2014 JoomlaWorks system 10019
User - K2
Site Plug-in 2.6.9 December 8th, 2014 JoomlaWorks user 10020
Thank you for your time!
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
- Posts: 15920
System - AutotweetK2,
K2 Integration- My Maps Location,
Canonical Links for K2
Try disabling these one by one to see if one of them is causing this issue.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.