- Posts: 4
COMMUNITY FORUM
Call to undefined method K2HelperHTML::loadjQuery()
- Philipp Schmidt
- Topic Author
- Offline
- New Member
Less
More
7 years 4 weeks ago #164973
by Philipp Schmidt
Call to undefined method K2HelperHTML::loadjQuery() was created by Philipp Schmidt
Hello Everybody,
my client has recently updated joomla to 3.8.1 and k2 to 2.8.0, and if he tries to acces the edit view for k2 items or k2 categories he is getting this error:
What can I do to fix it? Any Ideas?
my client has recently updated joomla to 3.8.1 and k2 to 2.8.0, and if he tries to acces the edit view for k2 items or k2 categories he is getting this error:
Call to undefined method K2HelperHTML::loadjQuery()
What can I do to fix it? Any Ideas?
Please Log in or Create an account to join the conversation.
- william white
- Offline
- Platinum Member
Less
More
- Posts: 3722
7 years 4 weeks ago #164976
by william white
Replied by william white on topic Call to undefined method K2HelperHTML::loadjQuery()
Make sure that load jQuery is set to load in K2 Options first
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 4 weeks ago #164977
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Call to undefined method K2HelperHTML::loadjQuery()
Please search the forum before posting.
This is related to an outdated K2 extension, K2 Multi Images in particular is known to cause this issue.
This is related to an outdated K2 extension, K2 Multi Images in particular is known to cause 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.
- Philipp Schmidt
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
7 years 4 weeks ago - 7 years 4 weeks ago #164978
by Philipp Schmidt
Replied by Philipp Schmidt on topic Call to undefined method K2HelperHTML::loadjQuery()
Do you mean the load jquery setting in the global k2 configuration? I have enabled it, but it did not change anything…
K2 Multi Images does not seam to be install. At least I cannot see it in the extension manager…
K2 Multi Images does not seam to be install. At least I cannot see it in the extension manager…
Last edit: 7 years 4 weeks ago by Philipp Schmidt.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 4 weeks ago #164987
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Call to undefined method K2HelperHTML::loadjQuery()
It can be another 3rd party K2 extension.
Disable them one by one in order to find the culprit.
Disable them one by one in order to find the culprit.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Philipp Schmidt
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
7 years 3 weeks ago - 7 years 3 weeks ago #165046
by Philipp Schmidt
Replied by Philipp Schmidt on topic Call to undefined method K2HelperHTML::loadjQuery()
After some debugging and digging in, i found that the reason for that issue is a k2 plugin which I wrote for the client. That plugin uses that xml manifest file:
All the comment blocks show fields which cause the error. So with those fields commented out, the error does not appear. What is wrong with that configuration?
<?xml version="1.0" encoding="utf-8"?>
<extension version="2.5" type="plugin" group="k2" method="upgrade">
<creationDate>March 17th, 2015</creationDate>
<copyright>All rights reserved.</copyright>
<description>A Plugin creating an extra field type to link to k2 items or categories</description>
<files>
<filename plugin="link">link.php</filename>
</files>
<fields
group="item-content"
addfieldpath="/administrator/components/com_k2/elements/">
<fieldset addfieldpath="/plugins/k2/link/elements">
<field
name="lnk_item"
type="item" default=""
label="K2_ADD_ITEMS" description="K2_USE_THIS_TO_ADD_ITEMS_TO_THE_LIST_BELOW" />
<!--
<field
name="lnk_items"
type="litems"
default=""
label="K2_DRAG_AND_DROP_TO_REORDER_ITEMS"
description="K2_DRAG_AND_DROP_TO_REORDER_ITEMS_CLICK_THE_REMOVE_ICON_TO_REMOVE_AN_ITEM_FROM_THE_LIST"/>
-->
<field
name="lnk_only"
type="radio"
default="0"
label="link only"
description="If set to Yes, the item itself will not appear in any Category listing but its Link instead">
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<!--
<field
name="lnk_category"
type="lcategoriesmultiple"
default=""
label="K2_SELECT_ONE_OR_MORE_CATEGORIES"
description="K2_SELECT_ONE_ORE_MORE_CATEGORIES_FOR_WHICH_YOU_WANT_TO_FILTER_AN_ITEMS_LIST_SELECT_NONE_TO_FETCH_ITEMS_FROM_ALL_CATEGORIES"/>
-->
</fieldset>
</fields>
<fields
group="category"
addfieldpath="/administrator/components/com_k2/elements/">
<fieldset addfieldpath="/plugins/k2/link/elements">
<field
name="lnk_item"
type="item" default=""
label="K2_ADD_ITEMS" description="K2_USE_THIS_TO_ADD_ITEMS_TO_THE_LIST_BELOW" />
<!--
<field
name="lnk_items"
type="litems"
default=""
label="K2_DRAG_AND_DROP_TO_REORDER_ITEMS"
description="K2_DRAG_AND_DROP_TO_REORDER_ITEMS_CLICK_THE_REMOVE_ICON_TO_REMOVE_AN_ITEM_FROM_THE_LIST"/>
<field
name="lnk_category"
type="lcategoriesmultiple"
default=""
label="K2_SELECT_ONE_OR_MORE_CATEGORIES"
description="K2_SELECT_ONE_ORE_MORE_CATEGORIES_FOR_WHICH_YOU_WANT_TO_FILTER_AN_ITEMS_LIST_SELECT_NONE_TO_FETCH_ITEMS_FROM_ALL_CATEGORIES"/>
-->
</fieldset>
</fields>
</extension>
All the comment blocks show fields which cause the error. So with those fields commented out, the error does not appear. What is wrong with that configuration?
Last edit: 7 years 3 weeks ago by Philipp Schmidt. Reason: missing word
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 2 weeks ago #165088
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Call to undefined method K2HelperHTML::loadjQuery()
Are you using any of K2's helper functions in your php files?
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Nadal Kumar
- Offline
- Junior Member
Less
More
- Posts: 28
7 years 2 weeks ago #165096
by Nadal Kumar
type="litems" should be type="items" to use the updated coding.
Replied by Nadal Kumar on topic Call to undefined method K2HelperHTML::loadjQuery()
Your xml is sourcing files from K2 elements directory which you must have duplicated and renamed. Those are the files which have been updated.Philipp Schmidt wrote: the reason for that issue is a k2 plugin which I wrote
type="litems" should be type="items" to use the updated coding.
Please Log in or Create an account to join the conversation.
- Philipp Schmidt
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
7 years 2 weeks ago #165099
by Philipp Schmidt
Replied by Philipp Schmidt on topic Call to undefined method K2HelperHTML::loadjQuery()
Thanks to Everybody for Help! After some long debugging I could finally find the issue.
1. administrator/components/com_k2/elements/items.php does not exist in k2 2.8.0, but that file is not removed by a Joomla! update, so it is still there.
2. Within the Plugin I have written, I have created two custom fields (litems, lcategories), which just altered the output of »items« and »categoriesmultiple« respectively and extended such.
Because of 1. that was actually working (litems.php):
So now I have to recreate a custom field which can be used to create a list of arbitrary items.
1. administrator/components/com_k2/elements/items.php does not exist in k2 2.8.0, but that file is not removed by a Joomla! update, so it is still there.
2. Within the Plugin I have written, I have created two custom fields (litems, lcategories), which just altered the output of »items« and »categoriesmultiple« respectively and extended such.
Because of 1. that was actually working (litems.php):
require_once (JPATH_ADMINISTRATOR.'/components/com_k2/elements/items.php');
class JFormFieldLitems extends K2ElementItems
{
public function fetchElement(…) {
$out = parent::fetchElement(…); //that caused the error
return preg_replace(…, …, $out);
}
}
So now I have to recreate a custom field which can be used to create a list of arbitrary items.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 2 weeks ago #165111
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Call to undefined method K2HelperHTML::loadjQuery()
Nice to hear that you sorted it out Philipp :)
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.