« Articoli sotto Magento

Magento Error /httpdocs/app/code/core/Mage/Core/Model/Url.php on line 341

Quando il file system.log nella cartella /var/log/ mostra:
Recoverable Error: Object of class Mage_Dataflow_Model_Profile_History could not be converted to string in /httpdocs/app/code/core/Mage/Core/Model/Url.php on line 341

o comunque un errore nel file Url.php alla riga 341

ho risolto seguendo questo thread:
http://www.magentocommerce.com/boards/viewthread/217741/

ovvero

open:


    code/core/Mage/Core/Model/Url.php
    Line 341

change

$a = explode('/', $data);

to


if (is_object($data)) {
    $sO = get_object_vars($data);
    //empty for admin login
    if (empty($sO)) $a = explode('/', $data);
    else return $this;
} else $a = explode('/', $data);

Aggiungere sidebar in Magento con Fishpig’s Integration x WordPress

SOURCE: http://fishpig.co.uk/wordpress-integration/adding-recent-posts-to-the-homepage/

<reference name="left">
<block type="wordpress/post_list_recent" name="wp.recent-posts" template="wordpress/post/recent.phtml">
<action method="setTitle"><title>Recent Posts</title></action>
<action method="setPostCount"><post_count>3</post_count></action>
</block>
</reference>

per semplicità aggiungere solo il codice seguente dentro ai reference già presenti nel template XML (es: page.xml)

<block type="wordpress/post_list_recent" name="wp.recent-posts" template="wordpress/post/recent.phtml">
<action method="setTitle"><title>Recent Posts</title></action>
<action method="setPostCount"><post_count>3</post_count></action>
</block>

è necessario customizzare il relativo file phtml in relazione al proprio design.

Aggiungere prodotti random in una page cms di Magento

Per aggiungere i prodotti random in una pagina cms di Magento:

{{block type="catalog/product_list_random" category_id="12" template="catalog/product/list.phtml"}}

Thanks to http://dx3webs.com/front/2010/10/how-to-create-a-random-featured-product-list-on-home-page-in-magento/

Fatal error in admin backend

ERROR:
Fatal error: Call to undefined method Mage_Adminhtml_Block_Widget::getrowurl() in …..app/code/core/Mage/Adminhtml/Block/Widget/Grid.php on line 1607

SOLUZIONE:

nel file app/code/core/Mage/Adminhtml/Block/Widget/Grid.php

sostituire alla riga 1620 questo

public function getRowUrl($item)
{
$res = parent::getRowUrl($item);
return ($res ? $res : ‘#’);
}

con questo:

public function getRowUrl($item)
{
$res = parent::getUrl($item);
return ($res ? $res : ‘#’);
}

Upgrading Magento from 1.3.2.3 to 1.4.0.1

Mi si è presentato questo report:
a:5:{i:0;s:79:"Invalid backend model specified: onsale/entity_attribute_backend_boolean_config";i:1;s:2060:"#0 /var/www/vhosts/ecobaby.it/httpdocs/new/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php(338): Mage::exception('Mage_Eav', 'Invalid backend...')

che dipende dal vecchio modulo di AheadWorks “OnSale” l’ho risolto postano nel database questa query:

SELECT *
FROM `ecobaby_new`.`eav_attribute`
WHERE (
`attribute_id` LIKE '%onsale%'
OR `entity_type_id` LIKE '%onsale%'
OR `attribute_code` LIKE '%onsale%'
OR `attribute_model` LIKE '%onsale%'
OR `backend_model` LIKE '%onsale%'
OR `backend_type` LIKE '%onsale%'
OR `backend_table` LIKE '%onsale%'
OR `frontend_model` LIKE '%onsale%'
OR `frontend_input` LIKE '%onsale%'
OR `frontend_label` LIKE '%onsale%'
OR `frontend_class` LIKE '%onsale%'
OR `source_model` LIKE '%onsale%'
OR `is_required` LIKE '%onsale%'
OR `is_user_defined` LIKE '%onsale%'
OR `default_value` LIKE '%onsale%'
OR `is_unique` LIKE '%onsale%'
OR `note` LIKE '%onsale%'
)
LIMIT 0 , 30

Split (deprecated) Vs. Explode

change split with explode

on php 5.3 split is

    deprecated

Magento Unable to access to administration

Unable to access to admin area.
Login is correct and no error shows:

This solution finally helped me out of this problem. The solution was to modify the core Magento code. Open app/code/core/Mage/Core/Model/Session/Abstract/Varien.php. Comment out the lines 80 to 83. The line number may vary according to the Magento version. But these lines are present somewhere near line 80. You have to comment the comma (,) in line: $this->getCookie()->getPath()//,
// set session cookie params
session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath()//,
//$this->getCookie()->getDomain(),
//$this->getCookie()->isSecure(),
//$this->getCookie()->getHttponly()
);

Well, I am out of this problem. Hope, this solution you also help you.

Update (For Magento 1.4.*)

In Magento 1.4, you have to comment code from line 86 to 98 in app/code/core/Mage/Core/Model/Session/Abstract/Varien.php. Like this:-
/* if (!$cookieParams['httponly']) {
unset($cookieParams['httponly']);
if (!$cookieParams['secure']) {
unset($cookieParams['secure']);
if (!$cookieParams['domain']) {
unset($cookieParams['domain']);
}
}
}

if (isset($cookieParams['domain'])) {
$cookieParams['domain'] = $cookie->getDomain();
} */

Credit to: http://blog.chapagain.com.np/magento-admin-login-problem/

Function split() is deprecated

ERRORE:

Unknown error (8192): Function split() is deprecated in /var/www/magento/app/code/core/Mage/Admin/Model/User.php on line 374

in
/app/code/core/Mage/Admin/Model/User.php o

alla riga 374

sostituire questa
$nodePath = ‘adminhtml/menu/’ . join(‘/children/’, split(‘/’, $startupPage)) . ‘/action’;

con questa
$nodePath = ‘adminhtml/menu/’ . join(‘/children/’, explode(‘/’, $startupPage)) . ‘/action’;

Magento – Can’t initialize indexer process

Problem after upgrade from 1.3.2.1 to 1.4.1

Can’t initialize indexer process

run the statement below on your database

 DROP TABLE IF EXISTS `index_process_event`;
DROP TABLE IF EXISTS `index_event`;
DROP TABLE IF EXISTS `index_process`;
 

CREATE TABLE `index_event` (
`event_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`type` VARCHAR(64) NOT NULL,
`entity` VARCHAR(64) NOT NULL,
`entity_pk` BIGINT(20) DEFAULT NULL,
`created_at` DATETIME NOT NULL,
`old_data` MEDIUMTEXT,
`new_data` MEDIUMTEXT,
PRIMARY KEY (`event_id`),
UNIQUE KEY `IDX_UNIQUE_EVENT` (`type`,`entity`,`entity_pk`)
) ENGINE=INNODB DEFAULT CHARSET=utf8;

CREATE TABLE `index_process` (
`process_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`indexer_code` VARCHAR(32) NOT NULL,
`status` ENUM('pending','working','require_reindex') NOT NULL DEFAULT 'pending',
`started_at` DATETIME DEFAULT NULL,
`ended_at` DATETIME DEFAULT NULL,
`mode` ENUM('real_time','manual') NOT NULL DEFAULT 'real_time',
PRIMARY KEY (`process_id`),
UNIQUE KEY `IDX_CODE` (`indexer_code`)
) ENGINE=INNODB  DEFAULT CHARSET=utf8;

INSERT  INTO `index_process`(`process_id`,`indexer_code`,`status`,`started_at`,`ended_at`,`mode`) VALUES (1,'catalog_product_attribute','pending','2010-02-13 00:00:00','2010-02-13 00:00:00','real_time'),(2,'catalog_product_price','pending','2010-02-13 00:00:00','2010-02-13 00:00:00','real_time'),(3,'catalog_url','pending','2010-02-13 19:12:15','2010-02-13 19:12:15','real_time'),(4,'catalog_product_flat','pending','2010-02-13 00:00:00','2010-02-13 00:00:00','real_time'),(5,'catalog_category_flat','pending','2010-02-13 00:00:00','2010-02-13 00:00:00','real_time'),(6,'catalog_category_product','pending','2010-02-13 00:00:00','2010-02-13 00:00:00','real_time'),(7,'catalogsearch_fulltext','pending','2010-02-13 00:00:00','2010-02-13 00:00:00','real_time'),(8,'cataloginventory_stock','pending','2010-02-13 00:00:00','2010-02-13 00:00:00','real_time');

CREATE TABLE `index_process_event` (
`process_id` INT(10) UNSIGNED NOT NULL,
`event_id` BIGINT(20) UNSIGNED NOT NULL,
`status` ENUM('new','working','done','error') NOT NULL DEFAULT 'new',
PRIMARY KEY (`process_id`,`event_id`),
KEY `FK_INDEX_EVNT_PROCESS` (`event_id`),
CONSTRAINT `FK_INDEX_EVNT_PROCESS` FOREIGN KEY (`event_id`) REFERENCES `index_event` (`event_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_INDEX_PROCESS_EVENT` FOREIGN KEY (`process_id`) REFERENCES `index_process` (`process_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=INNODB DEFAULT CHARSET=utf8;
IT WORKS
PROBLEM RESOLVED
MAGENTO FORUM REFERENCE