Skip to content

Commit 5967155

Browse files
author
Sikkema, Dale
committed
Merge pull request #611 from magento-extensibility/develop
[Extensibility] p0-1 bugs
2 parents 71955aa + 91afb3b commit 5967155

File tree

142 files changed

+2739
-710
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+2739
-710
lines changed

.htaccess

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44

55
# SetEnv MAGE_MODE developer
66

7-
############################################
8-
## overrides default umask value to allow using different
9-
## file permissions
10-
11-
# SetEnv MAGE_UMASK 022
12-
137
############################################
148
## uncomment these lines for CGI mode
159
## make sure to specify the correct cgi php binary file name
@@ -281,6 +275,10 @@
281275
order allow,deny
282276
deny from all
283277
</Files>
278+
<Files magento_umask>
279+
order allow,deny
280+
deny from all
281+
</Files>
284282

285283
################################
286284
## If running in cluster environment, uncomment this

.htaccess.sample

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,10 @@
274274
order allow,deny
275275
deny from all
276276
</Files>
277+
<Files magento_umask>
278+
order allow,deny
279+
deny from all
280+
</Files>
277281

278282
################################
279283
## If running in cluster environment, uncomment this

app/bootstrap.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
error_reporting(E_ALL);
1111
#ini_set('display_errors', 1);
1212

13-
/* Custom umask value may be provided in MAGE_UMASK environment variable */
14-
$mask = isset($_SERVER['MAGE_UMASK']) ? octdec($_SERVER['MAGE_UMASK']) : 002;
15-
umask($mask);
16-
1713
/* PHP version validation */
1814
if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50522) {
1915
if (PHP_SAPI == 'cli') {
@@ -34,6 +30,11 @@
3430
require_once __DIR__ . '/autoload.php';
3531
require_once BP . '/app/functions.php';
3632

33+
/* Custom umask value may be provided in optional mage_umask file in root */
34+
$umaskFile = BP . '/magento_umask';
35+
$mask = file_exists($umaskFile) ? octdec(file_get_contents($umaskFile)) : 002;
36+
umask($mask);
37+
3738
if (!empty($_SERVER['MAGE_PROFILER'])
3839
&& isset($_SERVER['HTTP_ACCEPT'])
3940
&& strpos($_SERVER['HTTP_ACCEPT'], 'text/html') !== false

app/code/Magento/Bundle/Model/Product/ReadHandler.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,12 @@ public function __construct(OptionRepository $optionRepository)
2929
}
3030

3131
/**
32-
* @param string $entityType
3332
* @param object $entity
3433
* @param array $arguments
3534
* @return \Magento\Catalog\Api\Data\ProductInterface
3635
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
3736
*/
38-
public function execute($entityType, $entity, $arguments = [])
37+
public function execute($entity, $arguments = [])
3938
{
4039
/** @var $entity \Magento\Catalog\Api\Data\ProductInterface */
4140
if ($entity->getTypeId() != \Magento\Bundle\Model\Product\Type::TYPE_CODE) {

app/code/Magento/Bundle/Model/Product/SaveHandler.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
* Copyright © 2016 Magento. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
76
namespace Magento\Bundle\Model\Product;
87

98
use Magento\Bundle\Api\ProductOptionRepositoryInterface as OptionRepository;
10-
use Magento\Framework\EntityManager\MetadataPool;
119
use Magento\Bundle\Api\ProductLinkManagementInterface;
1210
use Magento\Framework\EntityManager\Operation\ExtensionInterface;
1311

@@ -16,11 +14,6 @@
1614
*/
1715
class SaveHandler implements ExtensionInterface
1816
{
19-
/**
20-
* @var MetadataPool
21-
*/
22-
protected $metadataPool;
23-
2417
/**
2518
* @var OptionRepository
2619
*/
@@ -33,27 +26,23 @@ class SaveHandler implements ExtensionInterface
3326

3427
/**
3528
* @param OptionRepository $optionRepository
36-
* @param MetadataPool $metadataPool
3729
* @param ProductLinkManagementInterface $productLinkManagement
3830
*/
3931
public function __construct(
4032
OptionRepository $optionRepository,
41-
MetadataPool $metadataPool,
4233
ProductLinkManagementInterface $productLinkManagement
4334
) {
4435
$this->optionRepository = $optionRepository;
45-
$this->metadataPool = $metadataPool;
4636
$this->productLinkManagement = $productLinkManagement;
4737
}
4838

4939
/**
50-
* @param string $entityType
5140
* @param object $entity
5241
* @param array $arguments
5342
* @return \Magento\Catalog\Api\Data\ProductInterface|object
5443
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
5544
*/
56-
public function execute($entityType, $entity, $arguments = [])
45+
public function execute($entity, $arguments = [])
5746
{
5847
$bundleProductOptions = $entity->getExtensionAttributes()->getBundleProductOptions();
5948
if ($entity->getTypeId() !== 'bundle' || empty($bundleProductOptions)) {

app/code/Magento/Catalog/Model/Product/Gallery/CreateHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
use Magento\Framework\EntityManager\Operation\ExtensionInterface;
1111

1212
/**
13-
* Create handler for catalog product gallery.
13+
* Create handler for catalog product gallery
14+
*
1415
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1516
*/
1617
class CreateHandler implements ExtensionInterface
@@ -85,7 +86,6 @@ public function __construct(
8586
}
8687

8788
/**
88-
* @param string $entityType
8989
* @param object $product
9090
* @param array $arguments
9191
* @return object
@@ -94,7 +94,7 @@ public function __construct(
9494
* @SuppressWarnings(PHPMD.NPathComplexity)
9595
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
9696
*/
97-
public function execute($entityType, $product, $arguments = [])
97+
public function execute($product, $arguments = [])
9898
{
9999
$attrCode = $this->getAttribute()->getAttributeCode();
100100

app/code/Magento/Catalog/Model/Product/Gallery/ReadHandler.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,12 @@ public function __construct(
4040
}
4141

4242
/**
43-
* @param string $entityType
4443
* @param object $entity
4544
* @param array $arguments
4645
* @return object
4746
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
4847
*/
49-
public function execute($entityType, $entity, $arguments = [])
48+
public function execute($entity, $arguments = [])
5049
{
5150
$value = [];
5251
$value['images'] = [];

app/code/Magento/Catalog/Model/Product/Option/ReadHandler.php

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,44 +16,27 @@
1616
*/
1717
class ReadHandler implements ExtensionInterface
1818
{
19-
/**
20-
* @var OptionFactory
21-
*/
22-
protected $optionFactory;
23-
24-
/**
25-
* @var MetadataPool
26-
*/
27-
protected $metadataPool;
28-
2919
/**
3020
* @var ProductCustomOptionRepositoryInterface
3121
*/
3222
protected $optionRepository;
3323

3424
/**
3525
* @param ProductCustomOptionRepositoryInterface $optionRepository
36-
* @param MetadataPool $metadataPool
37-
* @param OptionFactory $optionFactory
3826
*/
3927
public function __construct(
40-
ProductCustomOptionRepositoryInterface $optionRepository,
41-
MetadataPool $metadataPool,
42-
OptionFactory $optionFactory
28+
ProductCustomOptionRepositoryInterface $optionRepository
4329
) {
4430
$this->optionRepository = $optionRepository;
45-
$this->metadataPool = $metadataPool;
46-
$this->optionFactory = $optionFactory;
4731
}
4832

4933
/**
50-
* @param string $entityType
5134
* @param object $entity
5235
* @param array $arguments
5336
* @return \Magento\Catalog\Api\Data\ProductInterface|object
5437
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
5538
*/
56-
public function execute($entityType, $entity, $arguments = [])
39+
public function execute($entity, $arguments = [])
5740
{
5841
$options = [];
5942
/** @var $entity \Magento\Catalog\Api\Data\ProductInterface */

app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,16 @@
33
* Copyright © 2016 Magento. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
76
namespace Magento\Catalog\Model\Product\Option;
87

98
use Magento\Catalog\Api\ProductCustomOptionRepositoryInterface as OptionRepository;
10-
use Magento\Framework\EntityManager\MetadataPool;
119
use Magento\Framework\EntityManager\Operation\ExtensionInterface;
1210

1311
/**
1412
* Class SaveHandler
1513
*/
1614
class SaveHandler implements ExtensionInterface
1715
{
18-
/**
19-
* @var MetadataPool
20-
*/
21-
protected $metadataPool;
22-
2316
/**
2417
* @var OptionRepository
2518
*/
@@ -30,21 +23,18 @@ class SaveHandler implements ExtensionInterface
3023
* @param MetadataPool $metadataPool
3124
*/
3225
public function __construct(
33-
OptionRepository $optionRepository,
34-
MetadataPool $metadataPool
26+
OptionRepository $optionRepository
3527
) {
3628
$this->optionRepository = $optionRepository;
37-
$this->metadataPool = $metadataPool;
3829
}
3930

4031
/**
41-
* @param string $entityType
4232
* @param object $entity
4333
* @param array $arguments
4434
* @return \Magento\Catalog\Api\Data\ProductInterface|object
4535
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
4636
*/
47-
public function execute($entityType, $entity, $arguments = [])
37+
public function execute($entity, $arguments = [])
4838
{
4939
/** @var \Magento\Catalog\Api\Data\ProductInterface $entity */
5040
foreach ($this->optionRepository->getProductOptions($entity) as $option) {

app/code/Magento/Catalog/Model/ResourceModel/Category.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -993,8 +993,8 @@ public function load($object, $entityId, $attributes = [])
993993
{
994994
$this->_attributes = [];
995995
$this->loadAttributesMetadata($attributes);
996-
$object = $this->getEntityManager()->load($object, $entityId, CategoryInterface::class, []);
997-
if (!$this->getEntityManager()->has($object, \Magento\Catalog\Api\Data\CategoryInterface::class, [])) {
996+
$object = $this->getEntityManager()->load($object, $entityId);
997+
if (!$this->getEntityManager()->has($object)) {
998998
$object->isObjectNew(true);
999999
}
10001000
return $this;
@@ -1005,7 +1005,7 @@ public function load($object, $entityId, $attributes = [])
10051005
*/
10061006
public function delete($object)
10071007
{
1008-
$this->getEntityManager()->delete($object, CategoryInterface::class, []);
1008+
$this->getEntityManager()->delete($object);
10091009
$this->_eventManager->dispatch(
10101010
'catalog_category_delete_after_done',
10111011
['product' => $object]
@@ -1022,7 +1022,7 @@ public function delete($object)
10221022
*/
10231023
public function save(\Magento\Framework\Model\AbstractModel $object)
10241024
{
1025-
$this->getEntityManager()->save($object, CategoryInterface::class, []);
1025+
$this->getEntityManager()->save($object);
10261026
return $this;
10271027
}
10281028

0 commit comments

Comments
 (0)