Skip to content
Permalink
Browse files

Merge branch 'b-6.1.x' into b-6.x

  • Loading branch information...
Farzam Tahmasebmirza
Farzam Tahmasebmirza committed Oct 31, 2019
2 parents 0059285 + 7e8fb6a commit 919fb4418d48ba268d8c9129ac0bc1d0622d53a6
@@ -197,12 +197,23 @@ protected function _getLoadActionsParam()
/**
* Template variable getter. Returns start page articles (OXSTART)
*
* @deprecated since v6.2.4 (2019-10-28)
* @return array
*/
public function getArticleList()
{
return [];
if ($this->_aArticleList === null) {
$this->_aArticleList = [];
if ($this->_getLoadActionsParam()) {
// start list
$oArtList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
$oArtList->loadActionArticles('OXSTART');
if ($oArtList->count()) {
$this->_aArticleList = $oArtList;
}
}
}
return $this->_aArticleList;
}
/**
@@ -2,6 +2,7 @@ SET @@session.sql_mode = '';
SET @defaultAdminId = MD5(UUID());

INSERT INTO `oxactions` (`OXID`, `OXSHOPID`, `OXTYPE`, `OXTITLE`, `OXTITLE_1`, `OXTITLE_2`, `OXTITLE_3`, `OXLONGDESC`, `OXLONGDESC_1`, `OXLONGDESC_2`, `OXLONGDESC_3`, `OXACTIVE`, `OXACTIVEFROM`, `OXACTIVETO`, `OXPIC`, `OXPIC_1`, `OXPIC_2`, `OXPIC_3`, `OXLINK`, `OXLINK_1`, `OXLINK_2`, `OXLINK_3`, `OXSORT`) VALUES
('oxstart', 1, 0, 'Startseite unten', 'Start page bottom', '', '', '', '', '', '', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '', '', '', '', '', '', '', '', 0),
('oxtopstart', 1, 0, 'Topangebot Startseite', 'Top offer start page', '', '', '', '', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '', '', '', '', '', '', '', '', 0),
('oxbargain', 1, 0, 'Angebot der Woche', 'Week''s Special', '', '', '', '', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '', '', '', '', '', '', '', '', 0),
('oxtop5', 1, 0, 'Topseller', 'Top seller', '', '', '', '', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '', '', '', '', '', '', '', '', 0),
@@ -319,6 +319,7 @@ REPLACE INTO `oxactions2article` (`OXID`, `OXSHOPID`, `O
('fa647a821cbb759a3.34804917', 1, 'oxbargain', '1001', 0),
('fa647a82200b834f6.31174235', 1, 'oxtop5', '1000', 0),
('fa647a821bcd6e225.88450924', 1, 'oxcatoffer', '1003', 5),
('fa647a821e4b8fa81.64242121', 1, 'oxstart', '1002', 0),
('fa647a821f27dbb38.79902594', 1, 'oxtopstart', '1001', 0);

#Article2Attribute
@@ -318,6 +318,7 @@ REPLACE INTO `oxactions2article` (`OXID`, `OXSHOPID`, `O
('fa647a821cbb759a3.34804917', 1, 'oxbargain', '1001', 0),
('fa647a82200b834f6.31174235', 1, 'oxtop5', '1000', 0),
('fa647a821bcd6e225.88450924', 1, 'oxcatoffer', '1003', 5),
('fa647a821e4b8fa81.64242121', 1, 'oxstart', '1002', 0),
('fa647a821f27dbb38.79902594', 1, 'oxtopstart', '1001', 0);

#Article2Attribute
@@ -19,6 +19,8 @@ UPDATE `oxnewssubscribed` SET OXUSERID = 'oxdefaultadmin' WHERE OXID='0b742e66fd
# Data for table `oxactions2article`
#
INSERT INTO `oxactions2article` (`OXID`, `OXSHOPID`, `OXACTIONID`, `OXARTID`, `OXSORT`) VALUES
('38c44b6536b1446e2.17112560', 1, 'oxstart', '943ed656e21971fb2f1827facbba9bec', 0),
('d8842e3c913930f47.00463447', 1, 'oxstart', '2077', 0),
('79042e787800a8465.75238508', 1, 'oxbargain', '85b42c94a32b3fdd2.66642220', 0),
('00f42e7bc564eb0c5.98400825', 1, 'oxtop5', '2080', 0),
('0a842e4f4e51ca939.48788613', 1, 'oxbargain', '1431', 1),
INSERT INTO `oxactions` (`OXID`, `OXSHOPID`, `OXSORT`, `OXTYPE`, `OXTITLE`, `OXTITLE_1`, `OXTITLE_2`, `OXTITLE_3`, `OXLONGDESC`, `OXLONGDESC_1`, `OXLONGDESC_2`, `OXLONGDESC_3`, `OXACTIVE`, `OXACTIVEFROM`, `OXACTIVETO`) VALUES
('d51dbdafb1e51b869f5d8ac233e97814', 1, 2, 2, 'Current Promotion', 'Current Promotion', '', '', '<a href="[{ oxgetseourl type=\'oxcategory\' oxid=\'8a142c3e60a535f16.78077188\' }]"> <img alt="" src="[{$oViewConf->getPictureDir()}]promo/current_de.jpg" /></a>', '<a href="[{ oxgetseourl type=\'oxcategory\' oxid=\'8a142c3e60a535f16.78077188\' }]"> <img alt="" src="[{$oViewConf->getPictureDir()}]promo/current_en.jpg" /></a>', '', '', 0, '2010-01-01 00:00:00', '2010-10-10 00:00:00'),
('d51f5e7446e9193188fb315c9d60520a', 1, 1, 2, 'Expired promotion', 'Expired promotion', '', '', '<a href="[{ oxgetseourl type=\'oxarticle\' oxid=\'1651\' }]"> <img alt="" src="[{$oViewConf->getPictureDir()}]promo/expired_de.jpg" /></a>', '<a href="[{ oxgetseourl type=\'oxarticle\' oxid=\'1651\' }]"> <img alt="" src="[{$oViewConf->getPictureDir()}]promo/expired_en.jpg" /></a>', '', '', 0, '2010-01-01 00:00:00', '2010-02-01 00:00:00'),
('d51545e80843be666a9326783a73e91d', 1, 3, 2, 'Upcoming Promotion', 'Upcoming Promotion', '', '', '<a href="[{ oxgetseourl type=\'oxmanufacturer\' oxid=\'9434afb379a46d6c141de9c9e5b94fcf\' }]"><img alt="" src="[{$oViewConf->getPictureDir()}]promo/upcoming_de.jpg" /></a>', '<a href="[{ oxgetseourl type=\'oxmanufacturer\' oxid=\'9434afb379a46d6c141de9c9e5b94fcf\' }]"><img alt="" src="[{$oViewConf->getPictureDir()}]promo/upcoming_en.jpg" /></a>', '', '', 0, '2010-10-10 00:00:00', '2011-10-10 00:00:00');
('d51545e80843be666a9326783a73e91d', 1, 3, 2, 'Upcoming Promotion', 'Upcoming Promotion', '', '', '<a href="[{ oxgetseourl type=\'oxmanufacturer\' oxid=\'9434afb379a46d6c141de9c9e5b94fcf\' }]"><img alt="" src="[{$oViewConf->getPictureDir()}]promo/upcoming_de.jpg" /></a>', '<a href="[{ oxgetseourl type=\'oxmanufacturer\' oxid=\'9434afb379a46d6c141de9c9e5b94fcf\' }]"><img alt="" src="[{$oViewConf->getPictureDir()}]promo/upcoming_en.jpg" /></a>', '', '', 0, '2010-10-10 00:00:00', '2011-10-10 00:00:00');

UPDATE `oxactions` SET OXACTIVE = '1' WHERE OXID='oxstart';
@@ -83,6 +83,8 @@ INSERT INTO `oxactions` (`OXID`, `OXSHOPID`, `OXTYPE`, `OXTITLE`, `OXTITLE_1`, `
# Data for table `oxactions2article`
#
INSERT INTO `oxactions2article` (`OXID`, `OXSHOPID`, `OXACTIONID`, `OXARTID`, `OXSORT`) VALUES
('d8842e3c913930f47.00463447', 1, 'oxstart', '2077', 0),
('a57e08935cd79c71f23b18a531890427', 1, 'oxstart', '058de8224773a1d5fd54d523f0c823e0', 1),
('79042e787800a8465.75238508', 1, 'oxbargain', '85b42c94a32b3fdd2.66642220', 0),
('b568de76c34bafb4b881b4774ea00f0e', 1, 'oxnewest', 'b56597806428de2f58b1c6c7d3e0e093', 6),
('95842e9fde5c6f051.82672143', 1, 'oxnewest', '1952', 3),
@@ -97,6 +99,7 @@ INSERT INTO `oxactions2article` (`OXID`, `OXSHOPID`, `OXACTIONID`, `OXARTID`, `O
('d8842e3ca342c5fb8.21231681', 1, 'oxtop5', '1940', 1),
('79042e78791e8ef10.24050762', 1, 'oxbargain', 'd8842e3cbf9290351.59301740', 0),
('d0c10b636f2303d6c422a2896464171a', 1, 'oxcatoffer', 'ed6573c0259d6a6fb641d106dcb2faec', 2),
('a57e05c9d11ea550a21c624482c6d095', 1, 'oxstart', 'ed6573c0259d6a6fb641d106dcb2faec', 2),
('d0cd4788290e30acd0fcc32e510e41c1', 1, 'oxcatoffer', 'ed6a4182ae58874e4fdaa4775566af6c', 3),
('b56b73a47578b357a761f696251ceb7d', 1, 'oxnewest', 'b563ab240dc19b89fc0349866b2be9c0', 7),
('c39e651303c494508b82463f638d2cd0', 1, 'oxtopstart', 'dc5ffdf380e15674b56dd562a7cb6aec', 1),
@@ -52,8 +52,10 @@ public function testGetRealSeoCanonicalUrl()
public function testGetArticleList()
{
$oStart = $this->getProxyClass('start');
$aList = $oStart->getArticleList();
$this->assertTrue(empty($aList));
$this->assertTrue($aList instanceof ArticleList);
$this->assertEquals(2, $aList->count());
}
public function testGetTopArticleList()
@@ -53,8 +53,10 @@ public function testGetRealSeoCanonicalUrl()
public function testGetArticleList()
{
$oStart = $this->getProxyClass('start');
$aList = $oStart->getArticleList();
$this->assertTrue(empty($aList));
$this->assertTrue($aList instanceof articlelist);
$this->assertEquals(2, $aList->count());
}
public function testGetTopArticleList()
@@ -271,11 +271,12 @@ public function testLoadActionArticles()
}
$oTest = $this->getProxyClass('oxArticleList');
$oTest->loadActionArticles('oxtopstart');
$this->assertEquals(1, count($oTest));
$this->assertTrue($oTest['1849'] instanceof Article);
$this->assertEquals(89.9, $oTest['1849']->getPrice()->getBruttoPrice());
$this->assertEquals("Bar Butler 6 BOTTLES", $oTest['1849']->oxarticles__oxtitle->value);
$oTest->loadActionArticles('oxstart');
$this->assertEquals(2, count($oTest));
$this->assertTrue($oTest['2077'] instanceof Article);
$this->assertTrue($oTest['943ed656e21971fb2f1827facbba9bec'] instanceof Article);
$this->assertEquals(19, $oTest['2077']->getPrice()->getBruttoPrice());
$this->assertEquals("Kuyichi Jeans Mick", $oTest['943ed656e21971fb2f1827facbba9bec']->oxarticles__oxtitle->value);
}
/**
@@ -935,11 +935,11 @@ public function testAssign()
{
$oBase = new _oxBase();
$oBase->init("oxactions");
$select = "select * from oxactions where oxid = 'oxtopstart'";
$select = "select * from oxactions where oxid = 'oxstart'";
$oDB = oxDb::getDB(oxDB::FETCH_MODE_ASSOC);
$rs = $oDB->select($select);
$oBase->assign($rs->fields);
$this->assertEquals("oxtopstart", $oBase->getId());
$this->assertEquals("oxstart", $oBase->getId());
}
/**
@@ -952,11 +952,11 @@ public function testAssignWithoutShopId()
$oDB = oxDb::getDb(oxDB::FETCH_MODE_ASSOC);
$oBase = new _oxBase();
$oBase->init("oxactions");
$oBase->oxactions__oxid = new oxField("oxtopstart", oxField::T_RAW);
$select = "select * from oxactions where oxid = 'oxtopstart'";
$oBase->oxactions__oxid = new oxField("oxstart", oxField::T_RAW);
$select = "select * from oxactions where oxid = 'oxstart'";
$rs = $oDB->select($select);
$oBase->assign($rs->fields);
$this->assertEquals($oBase->getId(), "oxtopstart");
$this->assertEquals($oBase->getId(), "oxstart");
}
/**
@@ -968,7 +968,7 @@ public function testAssignWithEmptyData()
{
$oBase = new _oxBase();
$oBase->init("oxactions");
$oBase->oxactions__oxid = new oxField("oxtopstart", oxField::T_RAW);
$oBase->oxactions__oxid = new oxField("oxstart", oxField::T_RAW);
$oBase->assign("aaa");
$this->assertEquals($oBase->getId(), null);
}
@@ -1001,11 +1001,11 @@ public function testSetFieldData()
{
$oBase = new _oxBase();
$oBase->init("oxactions");
$rs = array("oxid" => "oxtopstart", "oxtitle" => "Startseite unten");
$rs = array("oxid" => "oxstart", "oxtitle" => "Startseite unten");
foreach ($rs as $name => $value) {
$oBase->setFieldData($name, $value);
}
$this->assertEquals($oBase->oxactions__oxid->value, "oxtopstart");
$this->assertEquals($oBase->oxactions__oxid->value, "oxstart");
$this->assertEquals($oBase->oxactions__oxtitle->value, "Startseite unten");
}
@@ -1018,11 +1018,11 @@ public function testSetFieldDataLongName()
{
$oBase = new _oxBase();
$oBase->init("oxactions");
$rs = array("oxid" => "oxtopstart", "oxactions__oxtitle" => "Startseite unten");
$rs = array("oxid" => "oxstart", "oxactions__oxtitle" => "Startseite unten");
foreach ($rs as $name => $value) {
$oBase->setFieldData($name, $value);
}
$this->assertEquals($oBase->oxactions__oxid->value, "oxtopstart");
$this->assertEquals($oBase->oxactions__oxid->value, "oxstart");
$this->assertEquals($oBase->oxactions__oxtitle->value, "Startseite unten");
}
@@ -1036,12 +1036,12 @@ public function testSetFieldDataNonExistingLazyLoading()
$oBase = new _oxBase();
$oBase->setClassVar("_blUseLazyLoading", true);
$oBase->init("oxactions");
$rs = array("oxid" => "oxtopstart", "oxactions__oxtestval" => "Startseite unten", "oxtestval2" => "TestVal2");
$rs = array("oxid" => "oxstart", "oxactions__oxtestval" => "Startseite unten", "oxtestval2" => "TestVal2");
foreach ($rs as $name => $value) {
$oBase->setFieldData($name, $value);
}
//standard field
$this->assertEquals($oBase->oxactions__oxid->value, "oxtopstart");
$this->assertEquals($oBase->oxactions__oxid->value, "oxstart");
//was not set before
//T2008-09-03
//$this->assertFalse(isset($oBase->oxactions__oxtestval));
@@ -1062,12 +1062,12 @@ public function testSetFieldDataNonExistingNonLazyLoading()
$oBase->setNonPublicVar("_sCoreTable", "oxactions");
$aFieldNames = $oBase->getNonPublicVar('_aFieldNames');
$this->assertFalse(isset($aFieldNames['oxtitle']));
$rs = array("oxid" => "oxtopstart", "oxtitle" => "Startseite unten");
$rs = array("oxid" => "oxstart", "oxtitle" => "Startseite unten");
foreach ($rs as $name => $value) {
$oBase->UNITsetFieldData($name, $value);
}
//standard field
$this->assertEquals($oBase->oxactions__oxid->value, "oxtopstart");
$this->assertEquals($oBase->oxactions__oxid->value, "oxstart");
//was not set before
$this->assertTrue(isset($oBase->oxactions__oxtitle));
$aFieldNames = $oBase->getNonPublicVar('_aFieldNames');
@@ -1083,8 +1083,8 @@ public function testGetFieldData()
{
$oBase = new _oxBase();
$oBase->init("oxactions");
$oBase->oxactions__oxid = new oxField("oxtopstart", oxField::T_RAW);
$this->assertEquals("oxtopstart", $oBase->getFieldData("oxid"));
$oBase->oxactions__oxid = new oxField("oxstart", oxField::T_RAW);
$this->assertEquals("oxstart", $oBase->getFieldData("oxid"));
}
/**
@@ -1109,8 +1109,8 @@ public function testLoad()
$oBase = new _oxBase();
$oBase->modifyCacheKey(null, true);
$oBase->init("oxactions");
$oBase->load("oxtopstart");
$this->assertEquals($oBase->getId(), "oxtopstart");
$oBase->load("oxstart");
$this->assertEquals($oBase->getId(), "oxstart");
$this->assertTrue(isset($oBase->oxactions__oxtitle));
}
@@ -1148,9 +1148,9 @@ public function testLoadLazy1()
$oBase = new _oxBase();
$oBase->enableLazyLoading();
$oBase->init("oxactions");
$oBase->load("oxtopstart");
$oBase->load("oxstart");
$this->assertEquals("oxtopstart", $oBase->getId());
$this->assertEquals("oxstart", $oBase->getId());
$this->assertFalse($oBase->isPropertyLoaded('oxactions__oxtitle'));
}
@@ -1200,10 +1200,10 @@ public function testBuildSelectString()
$oBase = oxNew('oxBase');
$oBase->init("oxactions");
$sView = getViewName("oxactions", -1);
$sSelect = $oBase->buildSelectString(array("$sView.oxid" => "oxtopstart"));
$sSelect = $oBase->buildSelectString(array("$sView.oxid" => "oxstart"));
$sSelect = str_replace(" ", " ", $sSelect);
$this->assertEquals("select `$sView`.`oxid`, `$sView`.`oxshopid`, `$sView`.`oxtype`, `$sView`.`oxtitle`, `$sView`.`oxtitle_1`, `$sView`.`oxtitle_2`, `$sView`.`oxtitle_3`, `$sView`.`oxlongdesc`, `$sView`.`oxlongdesc_1`, `$sView`.`oxlongdesc_2`, `$sView`.`oxlongdesc_3`, `$sView`.`oxactive`, `$sView`.`oxactivefrom`, `$sView`.`oxactiveto`, `$sView`.`oxpic`, `$sView`.`oxpic_1`, `$sView`.`oxpic_2`, `$sView`.`oxpic_3`, `$sView`.`oxlink`, `$sView`.`oxlink_1`, `$sView`.`oxlink_2`, `$sView`.`oxlink_3`, `$sView`.`oxsort`, `$sView`.`oxtimestamp` from $sView where 1 and $sView.oxid = 'oxtopstart'", $sSelect);
$this->assertEquals("select `$sView`.`oxid`, `$sView`.`oxshopid`, `$sView`.`oxtype`, `$sView`.`oxtitle`, `$sView`.`oxtitle_1`, `$sView`.`oxtitle_2`, `$sView`.`oxtitle_3`, `$sView`.`oxlongdesc`, `$sView`.`oxlongdesc_1`, `$sView`.`oxlongdesc_2`, `$sView`.`oxlongdesc_3`, `$sView`.`oxactive`, `$sView`.`oxactivefrom`, `$sView`.`oxactiveto`, `$sView`.`oxpic`, `$sView`.`oxpic_1`, `$sView`.`oxpic_2`, `$sView`.`oxpic_3`, `$sView`.`oxlink`, `$sView`.`oxlink_1`, `$sView`.`oxlink_2`, `$sView`.`oxlink_3`, `$sView`.`oxsort`, `$sView`.`oxtimestamp` from $sView where 1 and $sView.oxid = 'oxstart'", $sSelect);
}
/**
@@ -1267,11 +1267,11 @@ public function testBuildSelectStringWithoutWhere()
*/
public function testSelectExistingData()
{
$sSelect = "select oxactions.oxid, oxactions.oxtitle from oxactions where oxactions.oxid = 'oxtopstart'";
$sSelect = "select oxactions.oxid, oxactions.oxtitle from oxactions where oxactions.oxid = 'oxstart'";
$oBase = new _oxBase();
$oBase->init('oxactions');
$this->assertEquals($oBase->assignRecord($sSelect), true);
$this->assertEquals($oBase->oxactions__oxid->value, 'oxtopstart');
$this->assertEquals($oBase->oxactions__oxid->value, 'oxstart');
}
/**
@@ -1320,7 +1320,7 @@ public function testExists()
{
$oBase = new _oxBase();
$oBase->init("oxactions");
$oBase->setId("oxtopstart");
$oBase->setId("oxstart");
$this->assertTrue($oBase->exists());
}
@@ -1346,7 +1346,7 @@ public function testExistsWithId()
{
$oBase = new _oxBase();
$oBase->init("oxactions");
$this->assertTrue($oBase->exists("oxtopstart"));
$this->assertTrue($oBase->exists("oxstart"));
}
/**
@@ -1486,9 +1486,9 @@ public function testSaveIfExists()
->method('update')
->will($this->returnValue(true));
$oBase->init('oxactions');
$oBase->setId('oxtopstart');
$oBase->setId('oxstart');
$sResult = $oBase->save();
$this->assertEquals('oxtopstart', $sResult);
$this->assertEquals('oxstart', $sResult);
}
/**
@@ -1500,7 +1500,7 @@ public function testSaveIfFieldsNotSet()
{
$oBase = new _oxBase();
$oBase->init("oxactions");
$oBase->setId("oxtopstart");
$oBase->setId("oxstart");
$oBase->setClassVar("_aFieldNames", null);
$this->assertFalse($oBase->save());
}
@@ -1551,7 +1551,7 @@ public function testSaveIsDerived()
->method('update')
->will($this->returnValue(true));
$oBase->init("oxactions");
$oBase->setId("oxtopstart");
$oBase->setId("oxstart");
$oBase->setIsDerived(true);
$sResult = $oBase->save();
$this->assertFalse($sResult);

0 comments on commit 919fb44

Please sign in to comment.
You can’t perform that action at this time.