Author Topic: Categories problems after update to 3.2.0  (Read 14645 times)

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9634
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Categories problems after update to 3.2.0
« Reply #105 on: March 21, 2018, 09:48:38 am »
I had the same problem, after 3 days of going crazy and testing, modifying, reading etc, i kinda figure it out .
all the little crocks and screws that make  Joomla and VirtueMart works are version dependent .

Of course, any version is different and one of the reason is to fix problems, which appear due new joomla versions.

After i had the "F**ck IT " moment ,and some "AHA" moment i decided downgrade the current version that i had. I thought that " if worked perfectly with older version, ill keep the older version till they find a fix " .
Prior to this i had Joomla update, witch was Joomla 3.8.6.

In this case, joomla has nothing todo with it, as far as I know. There is also no problem in VM. The problem with the ajax category feature is
a) an installed server mode, which uses page caches extraordinary
b) a browser plugin or configuration, which uses the browser cache extraordinary
c) a joomla extension, which enables own caches
d) a 3rd party component which breaks the js on your page (that was the case of Kamnaderi).

I would start with D) actually.

i took a look at stable pack of VM that comes with Joomla and i noticed something.....
Full installer includes Joomla 3.8.3 with VirtueMart 3.2.12 installed. And there was my AHA moment.

When updating current Joomla, take a look what VM works with what. if things get screw-y ...downgrade.
Hope it helps someone else in the future.

So you say downgrading to joomla 3.8.3 solved your problem? That is indeed very strange. Maybe 3rd party component, which uses js creates an error with later joomla version. I think they upgraded the jQuery.min version. Probably the problem is there.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3330
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Categories problems after update to 3.2.0
« Reply #106 on: March 21, 2018, 19:06:37 pm »

In this case, joomla has nothing todo with it, as far as I know. There is also no problem in VM. The problem with the ajax category feature is
a) an installed server mode, which uses page caches extraordinary
b) a browser plugin or configuration, which uses the browser cache extraordinary
c) a joomla extension, which enables own caches
d) a 3rd party component which breaks the js on your page (that was the case of Kamnaderi).
E) Most time, it's when you activate PHP debug error. Any PHP displayed error break any json, not only Virtuemart, but other Joomla extensions do not use Json(or only some)
So check if you dont actiavted PHP errror in Joomla config and set it to 'none'

solarangellis

  • Beginner
  • *
  • Posts: 9
    • Agriculture
  • VirtueMart Version: 3.2. - ish
Re: Categories problems after update to 3.2.0
« Reply #107 on: March 27, 2018, 12:19:39 pm »
So you say downgrading to joomla 3.8.3 solved your problem? That is indeed very strange. Maybe 3rd party component, which uses js creates an error with later joomla version. I think they upgraded the jQuery.min version. Probably the problem is there.

Yea, ill have to take that back. Problem is still there. (  tho it did work for a while, but now it's back to it's old tricks again )
So:
New product -> Select category dosent work .
Old product -> it dose show in witch category it is . Select some +other category and save -> works . (kinda, sometimes save, sometimes jumps out of any category, save, category still there, or it jumps it out. )
Old product  with no category -> ...don't get me started.


the "getCategoriesTree&virtuemart_product_id=155&format=json" - it works , it calls the category-tree.  so the Category Tree is there. but is not being feed or w/e. (  ???  )

mkay, this being said.

Ive look around in product_edit_information.php and got me curious .   Za code that makes " Select Manufacturer "  works like a charm.  Tho  " Select Categories" is f**ing picky, screwy, and whatnot .
And this code is from VirtueMart3.2.12_Joomla_3.8.3-Stable-Full_Package (  \administrator\components\com_virtuemart\views\product\tmpl ) that calls the manufacturer to be selected in the product info.

Code: [Select]
<tr class="row<?php echo $i?>">
<?php if(isset($this->lists['manufacturers'])) { ?>
<td>
<?php echo vmText::_('COM_VIRTUEMART_MANUFACTURER'?>
</td>
<td>
<?php echo $this->lists['manufacturers'];?>
</td>
<?php } else {
echo '<td></td><td></td>';
}?>

<td>
<?php echo vmText::_('COM_VIRTUEMART_PRODUCT_DETAILS_PAGE'?>
</td>
<td>
<?php echo JHTML::_('Select.genericlist'$this->productLayouts'layout''size=1''value''text'$this->product->layout); ?>
</td>
<td>
<?php echo vmText::_('COM_VIRTUEMART_PRODUCT_FORM_URL'?>
</td>
<td>
<input type="text" class="inputbox" name="product_url" value="<?php echo $this->product->product_url?>" size="32" maxlength="255" />
</td>
</tr>

and down below , this is the code that calls for Category


Code: [Select]
<tr class="row<?php echo $i?>">
<td>
<?php echo vmText::_('COM_VIRTUEMART_CATEGORY_S'?>
</td>
<td>
<select class="vm-drop" id="categories" name="categories[]" multiple="multiple"  data-placeholder="<?php echo vmText::_('COM_VIRTUEMART_DRDOWN_SELECT_SOME_OPTIONS')  ?>" size="100" >

</select> </td>
<?php
// It is important to have all product information in the form, since we do not preload the parent
// I place the ordering here, maybe we make it editable later.
if(!isset($this->product->ordering)) {
$this->product->ordering 0;
?>
<input type="hidden" value="<?php echo $this->product->ordering ?>" name="ordering"> <?php
?>

<td>
<span class="hasTip" title="<?php echo vmText::('COM_VIRTUEMART_SHOPPER_FORM_GROUP_PRODUCT_TIP'); ?>">
<?php echo vmText::_('COM_VIRTUEMART_SHOPPER_FORM_GROUP'?></span>
</td>
<td>
<?php echo $this->shoppergroupList?>
</td>
<?php if($this->showVendors()) { ?>
<td>
<?php echo vmText::_('COM_VIRTUEMART_VENDOR'?>
</td>
<td>
<?php echo $this->lists['vendors'];?>
</td>
<?php } else {
echo '<td><td>';
}?>

</tr>



to make it clear, and to point what bugs me. And if there is a problem or a small fix that it could be done, because honestly, iz driving me kinda insane.

Za code for Manufacturer
Code: [Select]
<td>
<?php echo vmText::_('COM_VIRTUEMART_MANUFACTURER'?>
</td>
<td>
<?php echo $this->lists['manufacturers'];?>
</td>
Za code for Category.

Code: [Select]
<td>
<?php echo vmText::_('COM_VIRTUEMART_CATEGORY_S'?>
</td>
<td>
<select class="vm-drop" id="categories" name="categories[]" multiple="multiple"  data-placeholder="<?php echo vmText::_('COM_VIRTUEMART_DRDOWN_SELECT_SOME_OPTIONS')  ?>" size="100" >

</select></td>

could be that is missing a <?php echo $this->lists['categories'];?>  or that "this"  is being feed via json or javascript ?



Also i have the :
Code: [Select]
Uncaught TypeError: Cannot read property 'VERSION' of undefined
    at bootstrap-tooltip-extended.min.js:6
    at bootstrap-tooltip-extended.min.js:6

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3330
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 &amp; 3.0.x.y
Re: Categories problems after update to 3.2.0
« Reply #108 on: March 27, 2018, 20:53:04 pm »
The list is get by json for categories, not for manufacturers, so the code is completly different.
You have certainly a javascript problem, try to clear your cache and check if you ahve an error on loading page in the browser console

solarangellis

  • Beginner
  • *
  • Posts: 9
    • Agriculture
  • VirtueMart Version: 3.2. - ish
Re: Categories problems after update to 3.2.0
« Reply #109 on: March 28, 2018, 12:42:00 pm »
wouldn't be better if we reroute this thingie via same process (?) like the manufacturer ?
at least for this part ? for the edit product information?

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3330
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 &amp; 3.0.x.y
Re: Categories problems after update to 3.2.0
« Reply #110 on: March 28, 2018, 16:33:18 pm »
wouldn't be better if we reroute this thingie via same process (?) like the manufacturer ?
at least for this part ? for the edit product information?
The problem is that category tree can be very big. This is why they have changed it.
In my case it work in more then 10 websites i manage, so it should work for you.
Perhaps you use a cache or a plugin add some values or javascript conflict, but its not a core problem, i'm the first to report when i see a bug.

solarangellis

  • Beginner
  • *
  • Posts: 9
    • Agriculture
  • VirtueMart Version: 3.2. - ish
Re: Categories problems after update to 3.2.0
« Reply #111 on: March 30, 2018, 13:32:53 pm »
...sigh





LE: image uploaded twice, dunno why.

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3330
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 &amp; 3.0.x.y
Re: Categories problems after update to 3.2.0
« Reply #112 on: March 30, 2018, 14:28:44 pm »
Is jQuery chosen loaded ?
You should have in head
<script src="/components/com_virtuemart/assets/js/chosen.jquery.min.js?vmver=236d5e81"></script>
If yes, Check if you have a 404 error for this file
If you have not a 404 then the script are not loaded in the right order
If this is not loaded, then you have disable it with a system plugin or perhaps in your Virtuemart config.

solarangellis

  • Beginner
  • *
  • Posts: 9
    • Agriculture
  • VirtueMart Version: 3.2. - ish
Re: Categories problems after update to 3.2.0
« Reply #113 on: March 30, 2018, 14:42:14 pm »
Code: [Select]
<script src="/components/com_virtuemart/assets/js/chosen.jquery.min.js?vmver=f51a2d79"></script>Yes it is loaded.

solarangellis

  • Beginner
  • *
  • Posts: 9
    • Agriculture
  • VirtueMart Version: 3.2. - ish
Re: Categories problems after update to 3.2.0
« Reply #114 on: March 30, 2018, 15:02:44 pm »
Mkay, this is the source output for the " New Product" in virtuemart

" The message exceeds the maximum allowed length (20000 characters). " ... i tried to copy-paste the code. ugh.

Ok, i deleted everything that was html content and left only the scripts.
.....
Code: [Select]
still too large.
i uploaded the damn  thingie.

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3330
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 &amp; 3.0.x.y
Re: Categories problems after update to 3.2.0
« Reply #115 on: March 30, 2018, 21:04:32 pm »
I dont have same script loaded in VirtueMart 3.2.12 but this have a little error:

Code: [Select]
<script id="updateChosen_js" type="text/javascript">//<![CDATA[
if (typeof Virtuemart === "undefined")
var Virtuemart = {};
Virtuemart.updateChosenDropdownLayout = function() {
var vm2string = {editImage: 'edit image',select_all_text: 'Select all',select_some_options_text: 'Available for all'};
jQuery("select:not(.vm-chzn-add)").chosen({enable_select_all: true,select_all_text : vm2string.select_all_text,select_some_options_text:vm2string.select_some_options_text,disable_search_threshold: 5});
//console.log("updateChosenDropdownLayout");
}
jQuery(document).ready( function() {
Virtuemart.updateChosenDropdownLayout($);
}); //]]>
</script>
Virtuemart.updateChosenDropdownLayout($); $ is not defined and can break in some browser

But your problem is certainly because this script, i dont have it in my case:
   <script src="https://www.mywebsite.ro/plugins/system/ytshortcodes/assets/js/loadconfig/shortcodes-backend.js"></script>
   <script src="/media/system/js/mootools-core.js?a3b577abad4a718677f8de790fee53c8"></script>
   <script src="/media/system/js/mootools-more.js?a3b577abad4a718677f8de790fee53c8"></script>
   <script src="/media/system/js/modal.js?a3b577abad4a718677f8de790fee53c8"></script>
mootools can conflict
shortcodes-backend ??? from ro (romania ?)
mootool modal that conflit with bootstrap modal.
You should check all plugin so this javascript are not loaded anymore and i think it work.
Note that Joomla backend dont need mootools anymore.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9634
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Categories problems after update to 3.2.0
« Reply #116 on: April 04, 2018, 10:45:31 am »
And this code is from VirtueMart3.2.12_Joomla_3.8.3-Stable-Full_Package (  \administrator\components\com_virtuemart\views\product\tmpl ) that calls the manufacturer to be selected in the product info.

....

Also i have the :
Code: [Select]
Uncaught TypeError: Cannot read property 'VERSION' of undefined
    at bootstrap-tooltip-extended.min.js:6
    at bootstrap-tooltip-extended.min.js:6

I wonder that you did not try to use the release candidate. Actually I found a problem with the category list using the FE managing, which is now fixed.

But the main problem seems to be here.
 <script src="https://www.mywebsite.ro/plugins/system/ytshortcodes/assets/js/loadconfig/shortcodes-backend.js"></script>
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

solarangellis

  • Beginner
  • *
  • Posts: 9
    • Agriculture
  • VirtueMart Version: 3.2. - ish
Re: Categories problems after update to 3.2.0
« Reply #117 on: April 14, 2018, 10:20:17 am »
3.2.14 did the trick. - love you guys.

i had to roll back everything, do the work, upgrade again and whatnot .
i still have no idea why or what was screwing with that thing in particular.
shortcodes-backend.js  this was not the culprit. i went and even wrote a custom php to block from getting loaded / integrated in the backend and still no dice .

shortcodes-backend ??? from ro (romania ?) - yea, the domain is romanian based. tho i have no idea why was it loading over like that, with the full domain attached to it .

escapezone

  • Beginner
  • *
  • Posts: 24
Re: Categories problems after update to 3.2.0
« Reply #118 on: May 10, 2018, 00:18:08 am »
VirtueMart 3.2.14
Joomla 3.8.7
PHP 7.0.30

Hello!
I had the problem with category...
I mean i could not assign category to a product ...
At my demo site i had VirtueMart 3.2.14  and Joomla 3.8.6 , when i upgrade to Joomla 3.8.7 the problem was appear!

So i replace the /components/com_ajax/ajax.php (from 3.8.7) with the ajax.php from Joomla 3.8.6 version....
and i put this code that found on this topic at .htaccess

 
Code: [Select]
<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On

# JSON no caching
ExpiresByType application/json                    "access plus 0 seconds"
ExpiresByType application/ld+json               "access plus 0 seconds"
ExpiresByType application/schema+json       "access plus 0 seconds"
ExpiresByType application/vnd.geo+json      "access plus 0 seconds"
ExpiresByType application/xml                     "access plus 0 seconds"
ExpiresByType text/xml                              "access plus 0 seconds"
</IfModule>

The problem solved!
But this .htaccess code i believed that works only with 3.8.6 Joomla ajax.php, I tested with 3.8.7 ajax.php and didn't worked.
I hope someone will found a permanent solution soon...
Thank you!
Regards!