[SOLVED] Errors! Plugin doesnt work!

  • mario2005
  • Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 9 months ago - 12 years 9 months ago #1040 by mario2005
Errors! Plugin doesnt work! was created by mario2005
Plugin is published.

First.

On the K2 Category Editing page I can select one of Group fields, I can select all of Group fields, but I cannot select no one. I mean, I can do that, but when I`m saving this changes and the page is refreshing, changes doesnt save. It is one or all of groups are selected again.


Second and most awful

On the K2 ITEM Editing page I see the error:
Code:
Warning: Missing argument 1 for TableK2Category::__construct(), called in Y:\home\expohim\www\plugins\k2\mefgfork2\mefgfork2.php on line 137 and defined in Y:\home\expohim\www\administrator\components\com_k2\tables\k2category.php on line 31
I see fields of second group and even can save them.

Also groups of fields doesn`t sorted correct. It shows fields of Group 1 at first, than all fields of Group 2, and than rest of Group 1.

[strike]But in the item page on front-end there is no any changes. Second groups fields aren`t visible!
[/strike]
This is wrong. On the ITEM PAGE on front-end the changes are visible. But,

1) The Fields are displayng without any order:

Group 1 Field
Group 2 Field
Group 1 Field
Group 2 Field
Group 1 Field
Group 2 Field
Group 1 Field
Group 1 Field
Group 1 Field
Group 1 Field


2) In ITEM PAGE on FRONTEND I see ALL GROUPS FIELDS even if in back-end in CATEGORY settings selected just one of GROUP FIELDS

Please help!
Last edit: 12 years 9 months ago by mario2005.

Please Log in or Create an account to join the conversation.

  • mario2005
  • Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 9 months ago #1041 by mario2005
Replied by mario2005 on topic Re: Errors! Plugin doesnt work!

Maxim wrote: Plugin is published.
Also groups of fields doesn`t sorted correct. It shows fields of Group 1 at first, than all fields of Group 2, and than rest of Group 1.


Actually, the thing is not about sorting. Group 1 fields is shown 2 times. At begining and at the end

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #1042 by mmmaug1977
Replied by mmmaug1977 on topic Re: Errors! Plugin doesnt work!
Hello Maxim,

All the errors and remarks listed here will be worked on and fixed asap.
Please let me know Joomla and K2 versions installed.

regarding the warning, it does not affect the plugin work, it shows because you may set the error reporting level to maximun in Configuration form of Joomla, anyway, it is recemmended to set it to system default or none on production sites.

regarding showing group 1 fields twice, make sure to select it only once in the category edit form.

It will be helpfull also if you can show me these problems on your site, at least the front-end.

Thanks

Please Log in or Create an account to join the conversation.

  • mario2005
  • Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 9 months ago - 12 years 9 months ago #1043 by mario2005
Replied by mario2005 on topic Re: Errors! Plugin doesnt work!
Hello, Zizo!

I understand the problem more, so I little bit changed the topic post. So repeat changing here:




[strike]But in the item page on front-end there is no any changes. Second groups fields aren`t visible![/strike]

This is wrong. On the ITEM PAGE on front-end the changes are visible. But,

1) The Fields are displayng without any order:

Group 1 Field
Group 2 Field
Group 1 Field
Group 2 Field
Group 1 Field
Group 2 Field
Group 1 Field
Group 1 Field
Group 1 Field
Group 1 Field








2) In ITEM PAGE on FRONTEND I see ALL GROUPS FIELDS even if in back-end in CATEGORY settings selected just one of GROUP FIELDS



3) Also attaching the pic from ITEM editing page. It`s in russian, but you can see the repeating fields of Group 2 and fields at first





K2 v2.6.2 and Joomla! 2.5.8
Last edit: 12 years 9 months ago by mario2005.

Please Log in or Create an account to join the conversation.

  • mario2005
  • Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 9 months ago - 12 years 9 months ago #1044 by mario2005
Replied by mario2005 on topic Re: Errors! Plugin doesnt work!
I found solution to fix problem 3, sort groups of fields for 1 ... 2... 3.. and make the labels of GROUPS more visible on ITEM editing page

make it as on picture below






You have to change in file mefgfork2.php lines form 147 to 166 with:
Code:
$efg = $plugins->get('efg'); if ($efg) { sort($efg); } $extraFieldModel = K2Model::getInstance('ExtraField', 'K2Model'); $output = ''; foreach ($efg as $group) { $extraFields = $extraFieldModel->getExtraFieldsByGroup($group); if (sizeof($extraFields)) { $output .= '<tr><td style="text-align:center;line-height:22px;font-size:16px;font-weight:bold;background-color:#bbb;" class="key" colspan="2">Group ID:' . $group . '</td></tr>'; for ($i = 0; $i < sizeof($extraFields); $i++) { $output .='<tr>'; $output .='<td align="right" class="key">' . $extraFields[$i]->name . '</td>'; $output .='<td>' . $extraFieldModel->renderExtraField($extraFields[$i], $item->id) . '</td>'; $output .='</tr>'; } } } $db = JFactory::getDbo(); ob_start(); ?> jQuery(document).ready(function() { <?php if ($efg) { ?> jQuery("#extraFields tr").remove(); <?php } ?> jQuery("#extraFields tbody").after(<?php echo $db->quote($output);?>);


This fix doesnt work if you change the category of item.




P.S. I`m not pretend to be a great developer but I really think that this fix can do this pulgin much better and usefull

P.S.S. If you wanna do the best, change Group ID for Group NAME. Name`s of groups will be much more usefull than ID`s.

The same thing (output with Names of Group) have to be at FRONT END. At least the opportunity to show them
Last edit: 12 years 9 months ago by mario2005.

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #1045 by kwoditz1
Replied by kwoditz1 on topic Re: Errors! Plugin doesnt work!
I have the same problems as Maxim.
Extra field layout is in mess.
Unfortunately the plugin is completely unusable until you correct these errors.

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #1046 by mmmaug1977
Replied by mmmaug1977 on topic Re: Errors! Plugin doesnt work!
Hello Karlo,

I'm working on fixing the errors, you can say 33% is done right now.

I will update all the customers as soon as finished.

P.S.
The plugin role is not to layout the extra fields in the front end, you should override the layout in the item template, if you need that.

The plugin only makes the extra fields available to display as needed on the front-end.

Thanks

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #1047 by mmmaug1977
Replied by mmmaug1977 on topic Re: Errors! Plugin doesnt work!
Hello Maxim and Karlo,

I have fixed the following:

1- The ordering of extra fields displayed on the front-end according to group and ordering specified in the backend.
2- When removing a group from a category, its fields are not displayed in the front-end.
3- Group names are diplayed in in the category edit form instead of group ids.

Still working on the bug of not saving changes when removing all the extra fields groups from the category edit form.

If you like to help in testing these fixes, I can send the modified file to you via email.

Thanks

Please Log in or Create an account to join the conversation.

  • mario2005
  • Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 9 months ago - 12 years 9 months ago #1048 by mario2005
Replied by mario2005 on topic Re: Errors! Plugin doesnt work!
Hi, Zizo!

You react pretty fast. That`s great.

I`ve installed new version of your plugin. The problem you wrote are fixed.


But one problem still exist. Look at attached file group2.png



On the Item Editing Page one of group fields repeating at the begining of all list of fields. One that choosed for category without your plugin.


To fix it you have to change in mefgfork2.php line 182
Code:
jQuery("#extraFields tr:last").after(<?php echo $db->quote($output);?>);

with
Code:
<?php if ($efg) { ?> jQuery("#extraFields tr").remove(); <?php } ?> jQuery("#extraFields tbody").after(<?php echo $db->quote($output);?>);
Last edit: 12 years 9 months ago by mario2005.

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #1049 by mmmaug1977
Replied by mmmaug1977 on topic Re: Errors! Plugin doesnt work!
Hi Maxim,

Thanks for your co-operation ;)

I hope you can write a review about the plugin in this page:
getk2.org/extend/extensions/1152-multipl...a-fields-groups-mefg


Please keep in touch

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum