Author Topic: [solved] vmError: $link["view"] is empty  (Read 13528 times)

lysov

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 105
    • Litera ltd
Re: [solved] vmError: $link["view"] is empty
« Reply #15 on: March 22, 2013, 18:33:29 pm »
Not solved at J! 2.5.9, VM 2.0.18c, the url is http://mir-parketa.spb.ru/index.php?option=com_virtuemart&view=category&virtuemart_category_id=43
Code: [Select]
vmdebug self::$_jpConfig->lang ru_ru
vmdebug vmTime: loadConfig db no: 0.00563311576843
vmdebug Start used Ram 12.5M
vmdebug my item with empty $link["view"] Var1:
stdClass Object
(
    [id] => 9
    [menutype] => left
    [title] => Паркетная доска
    [alias] => 2010-02-25-13-50-21
    [note] =>
    [path] => 2010-02-25-13-50-21
    [link] => index.php?option=com_virtuemart
    [type] => component
    [published] => 1
    [parent_id] => 1
    [level] => 1
    [component_id] => 0
    [ordering] => 2
    [checked_out] => 0
    [checked_out_time] => 0000-00-00 00:00:00
    [browserNav] => 0
    [access] => 1
    [img] =>
    [template_style_id] => 0
    [params] => {"product_id":"","category_id":7,"flypage":"","page":"","page_title":"","show_page_title":1,"pageclass_sfx":"","menu_image":"","secure":0,"show_page_heading":0}
    [lft] => 83
    [rgt] => 84
    [home] => 0
    [language] => *
    [client_id] => 0
)

Array
(
)
vmdebug my item with empty $link["view"] Var1:
stdClass Object
(
    [id] => 13
    [menutype] => right
    [title] => Прайс-лист
    [alias] => catalog
    [note] =>
    [path] => catalog
    [link] => index.php?option=com_virtuemart
    [type] => component
    [published] => 1
    [parent_id] => 1
    [level] => 1
    [component_id] => 0
    [ordering] => 5
    [checked_out] => 0
    [checked_out_time] => 0000-00-00 00:00:00
    [browserNav] => 0
    [access] => 1
    [img] =>
    [template_style_id] => 0
    [params] => {"product_id":"","category_id":"","flypage":"","page":"","page_title":"","show_page_title":1,"pageclass_sfx":"","menu_image":"","secure":0,"show_page_heading":0}
    [lft] => 129
    [rgt] => 134
    [home] => 0
    [language] => *
    [client_id] => 0
)

Array
(
)
vmdebug subtotal vattax id 1 = 0
vmdebug subtotal vattax id 1 = 0
vmdebug $this->category коллекция "SALSA"
vmdebug vmTime: VirtuemartControllerCategory Finished task : 0.337886095047
vmdebug End used Ram 21M
vmdebug Peak memory peak 21M
vmError: $link["view"] is empty
vmError: $link["view"] is empty


[attachment cleanup by admin]

lysov

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 105
    • Litera ltd
Re: [solved] vmError: $link["view"] is empty
« Reply #16 on: March 22, 2013, 18:51:19 pm »
Another example / url with this error (I switch on global SEO), the url is http://mir-parketa.spb.ru/store/корзина
Code: [Select]
vmdebug self::$_jpConfig->lang ru_ru
vmdebug vmTime: loadConfig db no: 0.00597500801086
vmdebug my item with empty $link["view"] Var1:
stdClass Object
(
    [id] => 9
    [menutype] => left
    [title] => Паркетная доска
    [alias] => 2010-02-25-13-50-21
    [note] =>
    [path] => 2010-02-25-13-50-21
    [link] => index.php?option=com_virtuemart
    [type] => component
    [published] => 1
    [parent_id] => 1
    [level] => 1
    [component_id] => 0
    [ordering] => 2
    [checked_out] => 0
    [checked_out_time] => 0000-00-00 00:00:00
    [browserNav] => 0
    [access] => 1
    [img] =>
    [template_style_id] => 0
    [params] => {"product_id":"","category_id":7,"flypage":"","page":"","page_title":"","show_page_title":1,"pageclass_sfx":"","menu_image":"","secure":0,"show_page_heading":0}
    [lft] => 83
    [rgt] => 84
    [home] => 0
    [language] => *
    [client_id] => 0
)

Array
(
)
vmdebug my item with empty $link["view"] Var1:
stdClass Object
(
    [id] => 13
    [menutype] => right
    [title] => Прайс-лист
    [alias] => catalog
    [note] =>
    [path] => catalog
    [link] => index.php?option=com_virtuemart
    [type] => component
    [published] => 1
    [parent_id] => 1
    [level] => 1
    [component_id] => 0
    [ordering] => 5
    [checked_out] => 0
    [checked_out_time] => 0000-00-00 00:00:00
    [browserNav] => 0
    [access] => 1
    [img] =>
    [template_style_id] => 0
    [params] => {"product_id":"","category_id":"","flypage":"","page":"","page_title":"","show_page_title":1,"pageclass_sfx":"","menu_image":"","secure":0,"show_page_heading":0}
    [lft] => 129
    [rgt] => 134
    [home] => 0
    [language] => *
    [client_id] => 0
)

Array
(
)
vmdebug Start used Ram 13.5M
vmdebug CustomsFieldCartDisplay Var1:
29::953:4;
vmdebug subtotal vattax id 1 = 0
vmdebug getOrderWeight Var1:
22.0000
vmdebug shipmentmethod Стандартная = TRUE for variable weight = 44 Reason: is within Range of the condition from 1 to 9999999999
vmdebug shipmentmethod Стандартная = TRUE for variable products quantity = 2 Reason: is within Range of the condition from 1 to 999999999
vmdebug shipmentmethod Стандартная = TRUE for variable order amount = 3500 Reason: no boundary conditions set
vmdebug shipmentmethod Стандартная = TRUE for variable zip = 194100 Reason: is within Range of the condition from 190000 to 199999
vmdebug shipmentmethod Стандартная = TRUE for variable virtuemart_country_id = 176, Reason: Country in rule or none set
vmdebug shipmentmethod Стандартная = TRUE for variable weight = 44 Reason: is within Range of the condition from 1 to 9999999999
vmdebug shipmentmethod Стандартная = TRUE for variable products quantity = 2 Reason: is within Range of the condition from 1 to 999999999
vmdebug shipmentmethod Стандартная = TRUE for variable order amount = 3500 Reason: no boundary conditions set
vmdebug shipmentmethod Стандартная = TRUE for variable zip = 194100 Reason: is within Range of the condition from 190000 to 199999
vmdebug shipmentmethod Стандартная = TRUE for variable virtuemart_country_id = 176, Reason: Country in rule or none set
vmdebug CustomsFieldCartDisplay Var1:
29::953:4;
vmdebug loginform $url Var1:
/store/корзина
vmdebug vmTime: VirtuemartControllerCart Finished task : 0.853842973709
vmdebug End used Ram 30.5M
vmdebug Peak memory peak 30.75M
This problem also is discussed at https://forum.virtuemart.net/index.php?topic=105330.0

Saliven007

  • Beginner
  • *
  • Posts: 5
Re: [solved] vmError: $link["view"] is empty
« Reply #17 on: April 05, 2013, 16:34:19 pm »
Do you using JoomSEF? If yes, check if plugin System - ARTIO JoomSEF isnt disabled ;-)

jillymot

  • Beginner
  • *
  • Posts: 35
Re: [solved] vmError: $link["view"] is empty
« Reply #18 on: April 08, 2013, 06:28:51 am »
I am getting this error and with vmdebug on I get the following message:

Quote
vmdebug self::$_jpConfig->lang en_gb
vmdebug vmTime: loadConfig db no: 0.003209114074707
vmdebug my item with empty $link["view"] Var1:

stdClass Object
(
    [id] => 21
    [menutype] => virtuemart
    [title] => Home
    [alias] => home-1
    [note] =>
    [path] => home-1
    [link] => index.php?option=com_virtuemart
    [type] => component
    [published] => 1
    [parent_id] => 1
    [level] => 1
    [component_id] => 10000
    [ordering] => 1
    [checked_out] => 0
    [checked_out_time] => 0000-00-00 00:00:00
    [browserNav] => 0
    [access] => 1
    [img] =>
    [template_style_id] => 0
    [params] => {"menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_text":1,"page_title":"","show_page_heading":0,"page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","robots":"","secure":0}
    [lft] => 61
    [rgt] => 62
    [home] => 0
    [language] => *
    [client_id] => 0

Could you please help interpret what the problem is and what action I need to take?  I am in the middle of upgrading this site and this message has only just started appearing during testing when I logged in as previous user and was taken to the page to update details.


UPDATE:  After viewing another forum post that suggested this was happening when logging in as a user who is an Administrator, I found this to be the case.  So will just setup another Registered user to test and fingers crossed won't see the error anymore. 

franzpeter

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 467
    • 2in1-online | Software, Mac, PC, Netzwerk, Drucker, Pad, Display
  • VirtueMart Version: Virtuemart 3.2.6
vmError: $link["view"] is empty
« Reply #19 on: April 10, 2013, 14:37:54 pm »
This is a very serious error and very bad for search engines. If a category for example is removed or if the slug changes, VM obviously uses something completely wrong. Instead, if VM frontpage for example is the default start page and if you enter the non existing url, VM does not show an error and does not search for the correct menu entry in the Joomla menu, which would be normally www.myhomepage.com for example (the menu link for VM if VM frontpage is the start page). Instead it uses something like www.myhomepage.com/index.php?option=com_virtuemart instead of the correct address which should be something like www.myhomepage.com/index.php?option=com_virtuemart&view=virtuemart for example. So a crawler, if a category is changed or deleted, does not get an error or a redirect to the correct homepage address, instead it is redirected to a physically non existing menu item, which returns duplicate meta infos a.s.o.. Very bad for search engines!!!

franzpeter

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 467
    • 2in1-online | Software, Mac, PC, Netzwerk, Drucker, Pad, Display
  • VirtueMart Version: Virtuemart 3.2.6
Re: [solved] vmError: $link["view"] is empty
« Reply #20 on: April 10, 2013, 15:59:25 pm »
I did find something, what could help until the developers remove that bug. In /components/com_virtuemart/virtuemart.php I did replace at the end of the file this:
} else {
    vmDebug('VirtueMart controller not found: '. $_class);
    $mainframe = Jfactory::getApplication();
    $mainframe->redirect('index.php?option=com_virtuemart');
}

with that:
} else {
    vmDebug('VirtueMart controller not found: '. $_class);
    $mainframe = Jfactory::getApplication();
    $mainframe->redirect(JRoute::_ ('index.php?option=com_virtuemart'));
}

Now, it works, hope so, as it should. The problem is, that obviously in case of not finding Virtuemart controller, it needs to be routed via JROUTE. But it is just a workaround. I think that the whole part of the mentioned code needs an overhaul. I do not understand if a menu entry in Joomla menu is available, why the debug function gets activated showing that the VirtueMart controller is not found!

A strange thing is, that with second level categories, if they get deleted or the slug is changed, that VM uses a modus, which shows all products.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10040
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: [solved] vmError: $link["view"] is empty
« Reply #21 on: April 10, 2013, 17:52:09 pm »
and how works this?
$mainframe->redirect('index.php?option=com_virtuemart&view=virtuemart');

Btw, the searchengines get a 404 if a product or category was not found, but the user should see the normal shop /category with the message product/category not found. This is the way I wrote it,... maybe there is a bug, but just that you guys know how it is intended.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

franzpeter

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 467
    • 2in1-online | Software, Mac, PC, Netzwerk, Drucker, Pad, Display
  • VirtueMart Version: Virtuemart 3.2.6
Re: [solved] vmError: $link["view"] is empty
« Reply #22 on: April 10, 2013, 18:23:15 pm »
Well Milbo,

that is another way to redirect but I think there is a problem with crawlers with the default code in virtuemart.php. If a category is not found and if VM is the default standard start page for Joomla, it produces some problems because you receive page doublets. index?option=com_virtuemart shows somehow the frontpage but only somehow. For a crawler it must look like a page doublet. Another thing is that: index.php?option=com_virtuemart&view=category&virtuemart_category_id=0. Entering that shows all products but that page is not linked to a Joomla menu, so it produces only acceptable results if you use the pagination. The default display is exactly the same problem as described with not found categories.
I see those problems in Google Webmaster tools and if they declare it as a problem, it is a problem. Those pages are outside the standard pages. They are not linked to Joomla, I would say that they work somehow in a panic mode.

And, in the case of products it works as described by you showing product not found. But I do not see any information if a category is not found. There is no error message and what the users and the crawlers see in case of not existing categories is the panic mode, the pseudo VM frontpage.

Just did try, what you proposed: $mainframe->redirect('index.php?option=com_virtuemart&view=virtuemart');

It delivers the panic mode page too. If I use
$mainframe->redirect(JRoute::_ ('index.php?option=com_virtuemart'));

it redirects to the correct homepage.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10040
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: [solved] vmError: $link["view"] is empty
« Reply #23 on: April 10, 2013, 21:03:01 pm »
And, in the case of products it works as described by you showing product not found. But I do not see any information if a category is not found. There is no error message and what the users and the crawlers see in case of not existing categories is the panic mode, the pseudo VM frontpage.

Haha panic mode, yes it is. It is a fallback. But this is a good hint. It shows me that I implemented it just not correct for the categories or maybe just forgot it. It is a long time ago that I wrote it.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

franzpeter

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 467
    • 2in1-online | Software, Mac, PC, Netzwerk, Drucker, Pad, Display
  • VirtueMart Version: Virtuemart 3.2.6
Re: [solved] vmError: $link["view"] is empty
« Reply #24 on: April 11, 2013, 14:12:06 pm »
I think it has to do something with url encoding. JRoute does create & a.s.o. if we use JRoute. So
this: $mainframe->redirect('index.php?option=com_virtuemart');

is different from:
$mainframe->redirect(JRoute::_ ('index.php?option=com_virtuemart'));
JRoute delivers something like: index.php%3Foption%3Dcom_virtuemart
while
index.php?option=com_virtuemart remains unencoded.
It works, as long as we only use VM methods, but if it is in Joomla (like the menu links), we have doublets, it delivers same page with slightly different content. So for example if we define VM categories and subcategories in a Joomla menu and we use something like a native VM module without JRoute, we have double urls, one encoded and one unencoded.