Showing ideas with status New.
Show all ideas
Feature request from Yonn-Trimoreau, posted on GitHub Feb 17, 2016
When I observe page_block_html_topmenu_gethtml_before event, just like Magento\Catalog\ObserverAddCatalogToTopmenuItemsObserver does, and add some items to the top.menu , I can't order the items I add (whether it should be displayed before or after category listing, for example).
I think it should be possible, since the "top menu" must be one of the first and most modified element on any website.
Maybe by adding a special \Magento\Framework\DataObject attribute "order" which will be used inside or before Magento\Theme\Block\Html 's _getHtml method, in a way to reorder the \Magento\Framework\Data\Tree\Node before rendering it ?
Or even clearer : adding a $_position property to the Node class, and a non-mandatory variable to the Node class constructor, which could be used in a similar way I expressed before ?
Simple, non-breaking, no performance issue, really useful. Right ?
I can try to make a pull request if you accept this issue.
... View more
Feature request from mikebranderhorst, posted on GitHub Feb 22, 2016
In .gitignore:
/vendor
!/vendor/.htaccess
Should be:
/vendor/*
!/vendor/.htaccess
This way /vendor/.htaccess is added to (private) repository (and with deployment the folder is created).
Maybe also add the third line (to make adding commercial packages possible by artifact)
https://getcomposer.org/doc/05-repositories.md#artifact
/vendor/*
!/vendor/.htaccess
!/vendor/artifacts/.htaccess
# uncomment when using a private repository and want to
# add artifact (commercial) packages to the repository
#!/vendor/artifacts/
Combined with an addition in composer.json
(composer config repositories.artifacts artifact vendor/artifacts)
"repositories": {
"artifacts": {
"type": "artifact",
"url": "vendor/artifacts"
}
},
And to keep the folder adding the file /vendor/artifacts/.htaccess
... View more
Feature request from rhoerr, posted on GitHub Feb 23, 2016
In brief: There seems to be an issue with \Magento\Catalog\Model\ProductRepository whereby it does not respect emulation, nor does it correctly identify the current scope in all situations.
The primary result of this when saving a product through ProductRepository from an affected scope is that (1) some attributes are saved in the fallback scope (default store) when that would not be expected, and (2) it seems to be impossible to associate a product to multiple websites.
Magento version: EE 2.0.2
Context: A custom controller in the admin panel extending \Magento\Backend\App\Action , for importing configurable products.
Tracing the issue:
\Magento\Catalog\Api\ProductRepositoryInterface is injected into the controller via DI.
We load $product , already having website_ids = [1, 2] (for reasons unclear, these are not returned by $product->getWebsiteIds() .)
We call $this->productRepository->save($product);
\Magento\Catalog\Model\ProductRepository::save() calls
ProductRepository->initializeProductData() calls
ProductRepository->assignProductToWebsites() calls
ProductRepository->storeManager->getStore() ( \Magento\Store\Model\StoreManager )
Having no currentStoreId, StoreManager calls
StoreManager->storeResolver->getCurrentStoreId() ( \Magento\Store\Model\StoreResolver ) calls
StoreResolver->getStoresData()
StoreResolver was initialized by DI with no runMode or scopeCode , therefore $this->runMode defaults to 'website', and $this->scopeCode defaults to 'null'.
With this state, StoreResolver::getStoresData() returns:
Array
(
[0] => Array // $stores
(
[0] => 1
)
[1] => 1 // $defaultStoreId
)
$store is loaded based on $defaultStoreId and returned to ProductRepository .
Bottom line: This results in ProductRepository->storeManager->getStore()->getCode() returning 'default', despite that we are in the admin scope.
Starting emulation on the admin store prior to this process has no bearing on the outcome.
Passing in a parameter of ___store='admin' has no bearing on the outcome (because admin is not a valid website code).
Expected behavior is that ProductRepository obeys the scope of whatever context it is called from, including emulation.
... View more
Feature request from damien-synolia, posted on GitHub Feb 24, 2016
Hello all,
I just launched the standard PHPUnit test (without the dev:tests:run command) :
php <magentodir>/vendor/phpunit/phpunit/phpunit --debug
I am in <magentodir>/dev/tests/unit directory.
There is a fatal error on Magento\DownloadableImportExport\Model\Import\Product\Type\Downloadable file. On function fillDataLink , there is a fillExistOptions call where $existingOptions is null. It should be an array. It's the same in fillDataTitleLink method.
I just add an ugly fix with a is_null check for $existingOptions and set it to an empty array and it works.
I think the best way should be to change the fetchAll method to always return an empty array, if no data is retrieved in database.
Is there something I did wrong ?
Damien.
... View more
Feature request from wojtekn, posted on GitHub Feb 24, 2016
I created module using "vendor/foobar" name in composer.json and used Vendor_FooBar namespace. The I run static tests and I get following error:
For the module 'Vendor_FooBar', the expected package name is 'vendor/foobar'
This error message is confusing because it says it expects package name I already used. As far as I understand it should say following:
For the module 'Vendor_FooBar', the expected package name is 'vendor/module-foo-bar'
If my assumption is correct, value of $this->convertModuleToPackageName($moduleName) should be used instead of $packageName in message returned in \Magento\Test\Integrity\ComposerTest::assertConsistentModuleName method.
I can do PR if it's helpful.
... View more
Feature request from ravbetsky, posted on GitHub Mar 01, 2016
Each change in requirers-config.js of our module doesn't take any effect. After we had removed pub/static/_requirejs/frontend/Magento/luma/en_US/requirejs-config.js our changes applied.
... View more
Feature request from wojtekn, posted on GitHub Mar 03, 2016
This isn't something big, but I think it may be worth to improve both phpunit.xml.dist files to make them working in similar way by default. For now the biggest difference is that integration tests don't include whole app/code but limit code coverage only to Magento code:
<directory suffix=".php">../../../app/code/Magento</directory>
Unit tests enable everything from app/code by default:
<directory suffix=".php">../../../app/code/*</directory>
Another improvements may include adding logging configuration example in integration tests and adjusting nodes order.
... View more
Feature request from erikhansen, posted on GitHub Mar 08, 2016
I'm using Capistrano to deploy Magento 2 to production and stage environments. As a part of the deployment process, I'm running the bin/magento setup:static-content:deploy command. However since Capistrano streams all output to screen, I see this:
So I've resorted to passing in the -q flag to silence all output: bin/magento setup:static-content:deploy -q . However this doesn't allow me to see progress as each theme is compiled. I'd like to see a flag added like --no-progress that would result in output like this:
php -f bin/magento -- setup:static-content:deploy --no-progress
Requested languages: en_US
=== frontend -> Magento/blank -> en_US ===
=== frontend -> Magento/luma -> en_US ===
=== frontend -> Customvendor/customtheme -> en_US ===
... View more
Feature request from davidverholen, posted on GitHub Mar 20, 2016
this is more of a minor design issue. I recently needed a method to normalize a file system path.
Looking at the core, I found the method(s) for this, but implemented directly in the classes where they are used:
https://github.com/magento/magento2/blob/2d82d19010a2deee42ab67e62627b84169f0ab8a/lib/internal/Magento/Framework/View/FileSystem.php#L169
https://github.com/magento/magento2/blob/2d82d19010a2deee42ab67e62627b84169f0ab8a/lib/internal/Magento/Framework/Setup/SampleData/FixtureManager.php#L62
As I did not really need any of the classes, I implemented this method (a third time) in my own class.
A good place would be maybe the Frameworks File System Class: https://github.com/magento/magento2/blob/2d82d19010a2deee42ab67e62627b84169f0ab8a/lib/internal/Magento/Framework/Filesystem.php
What do you think about it? I could start a small pull request for that
... View more
Feature request from pantaoran, posted on GitHub Mar 23, 2016
I observe that in app/code/Magento/Store/Model/ScopeInterface.php there are 5 different scope type constants which are ambiguous and probably should be unified.
interface ScopeInterface
{
/**#@+
* Scope types
*/
const SCOPE_STORES = 'stores';
const SCOPE_WEBSITES = 'websites';
const SCOPE_STORE = 'store';
const SCOPE_GROUP = 'group';
const SCOPE_WEBSITE = 'website';
/**#@-*/
}
Both "store/stores" and "website/websites" exist once in singular and once in plural. It is not clear to the developer in any way which one should be used.
We ran into this problem today in our team, where I wrote code to set some config values, and another team member wrote code to read them, but I used the plural constants and he used the singular ones. We didn't notice the problem for weeks because we always tested with the default config values and didn't bother to set storeview-specific ones, and even when we did, I guess they must use a fall-back to default scope values when the store specific ones are not found.
I searched through the core code for use, and both versions seem to be used, although the singular versions are used much more often. Can we please simplify this important interface to only use one spelling per type?
Or is there a compelling reason to keep both singular and plural for these that I'm not understanding? I feel strange for bringing this up here because I can't possibly be the first person to notice this...
... View more
Feature request from katesuykovskaya, posted on GitHub Mar 26, 2016
Steps to reproduce
M 2.0.2
go to admin panel -> Products -> Catalog -> edit product
open Images and Videos tab, click on image - dialog is shown
open source of page
Actual result
each time, when modal dialog is created, the old one isn't removed from DOM => when I choose images a lot of time, I got this
which makes using current / active dialog inconvenient using JS.
Expected Result
I should get one dialog, or at least one dialog per chosen image - it should not be duplicated.
... View more
Feature request from rkhoury82, posted on GitHub Mar 31, 2016
Steps to reproduce
Install Magento 2.0.3
Migrate or create a Configurable Product with 300 variations, save.
Go back into that product, press the "add products manually"
Expected result
With products with smaller variation sets the functionality works
I have increased the LimitRequestLine to work around 414 (Request-URI Too Large) error (per issue #3495)
I have not been able determine the size limit yet.
Actual result
Error Message Pops: Attention Something went wrong.
No browser messages in console.
Error in Apache Logs:
[Thu Mar 31 18:34:14.139835 2016] [proxy_fcgi:warn] [pid 4968] [client 60.225.85.XXX:37893] AH02536: couldn't encode envvar 'QUERY_STRING' in 16384 bytes, referer: http://EXAMPLE/admin/catalog/product/edit/id/3/key/81f78988e9908f8d89115a62f01eacdd8611886ce257a56bd9ec6c22d83930e6/
[Thu Mar 31 18:34:14.139840 2016] [proxy_fcgi:warn] [pid 4968] [client 60.225.85.XXX:37893] AH02536: couldn't encode envvar 'REQUEST_URI' in 16384 bytes, referer: http://EXAMPLE/admin/catalog/product/edit/id/3/key/81f78988e9908f8d89115a62f01eacdd8611886ce257a56bd9ec6c22d83930e6/
Environment
PHP 7.0.4 run as FPM not MOD_PHP (unable to test with 7.0.2 or 7.0.3 to see if it is a PHP error)
Apache 2.4.18
MYSQL 5.6
... View more
Feature request from 11mb, posted on GitHub Jun 30, 2016
Steps to reproduce
Install Magento 2.1
Login to admin
Goto Content >> Pages
Click Edit button for homepage
Edit content
Select text and click insert link
Click browse
Expected result
A list of links to cms pages, categories and products
Actual result
The mediabrowser opens
... View more
Feature request from bartek9007, posted on GitHub Jul 01, 2016
Steps to reproduce
Install Magento from develop branch.
Adding products programatically
Trying to edit added product and save it.
One of required attribute is null
Expected result
If I try to save product with required attribute Magento should abort it and point out which attribute is empty.
If it is not visible on menu it should automatically scroll down to its group.
Actual result
Button 'save' freezes out.
Attribute is pointed out with red triangle but if its group is out of current scope of view Magento doesn't scroll down to its group.
I have to scroll down in search of the group and attribute with error.
So it's quite uncomfortable and not intuituive if there is an error in very low sort order group becauce button 'save' just freeze and in the begining you don't know why it's not saving results.
... View more
Feature request from omdeshpande, posted on GitHub Jul 03, 2016
AOP implemented by the Plugins in Magento2 a good framework feature.
Currently, these AOP overrides work on the basis of one class at a time. What could be a great addition to this, is to have Spring (Java) like 'Pointcut patterns'. Pointcut patterns will make it possible to inject 'before', 'after' and 'around' to multiple functions and classes through a single statement. It will make plugin definitions more powerful and efficient. Would be great for something like logging.
Sample - http://docs.spring.io/spring/docs/current/spring-framework-reference/html/aop.html
If this makes sense to you guys, I'm open to contributing. Will be great to hear your thoughts!
... View more
Feature request from kandrejevs, posted on GitHub Jul 05, 2016
We have developed store with 3 languages- sk_SK, hu_HU, cs_CZ. Problem is that i18n:collect-phrases from root collects over 8000 strings including ones from adminhtml. We want only to translate frontend strings and leave backend in en_US locale. This can be achieved by creating csv file for every single module running command only on view/frontend directory. But that is time consuming.
Proposition: Add option to i18n:collect-phrases command, to exclude view/adminhtml directories and xml files that contains translatable strings for backend.
Here I played around a bit and made a small script that scans through app/code, theme and vendor folders, searches for base or frontend directory in view directory, translates it and in the end creates 2 csv files for comparison. in my case only frontend phrases are 770 vs 10 000 all phrases.
https://gist.github.com/kandrejevs/72dcc1cfd9841e3a646ffe1c23c73801
... View more
Feature request from tkn98, posted on GitHub Jul 06, 2016
Steps to reproduce
Install Magento from develop branch.
After all Modules are installed, a message is shown in green letters on the last line. Read that message.
The message says:
Please re-run Magento compile command
It can be greatly improved by removing the inaccuracy as there is no such command named " compile ". The command name is " setup:di:compile ".
This should be trivial to fix.
... View more
Feature request from rkhoury82, posted on GitHub Mar 31, 2016
Steps to reproduce
Install Magento 2.0.3
Migrate or create a Configurable Product with 300 variations, save.
Go back into that product, press the "add products manually"
Expected result
With products with smaller variation sets the functionality works
I have increased the LimitRequestLine to work around 414 (Request-URI Too Large) error (per issue #3495)
I have not been able determine the size limit yet.
Actual result
Error Message Pops: Attention Something went wrong.
No browser messages in console.
Error in Apache Logs:
[Thu Mar 31 18:34:14.139835 2016] [proxy_fcgi:warn] [pid 4968] [client 60.225.85.XXX:37893] AH02536: couldn't encode envvar 'QUERY_STRING' in 16384 bytes, referer: http://EXAMPLE/admin/catalog/product/edit/id/3/key/81f78988e9908f8d89115a62f01eacdd8611886ce257a56bd9ec6c22d83930e6/
[Thu Mar 31 18:34:14.139840 2016] [proxy_fcgi:warn] [pid 4968] [client 60.225.85.XXX:37893] AH02536: couldn't encode envvar 'REQUEST_URI' in 16384 bytes, referer: http://EXAMPLE/admin/catalog/product/edit/id/3/key/81f78988e9908f8d89115a62f01eacdd8611886ce257a56bd9ec6c22d83930e6/
Environment
PHP 7.0.4 run as FPM not MOD_PHP (unable to test with 7.0.2 or 7.0.3 to see if it is a PHP error)
Apache 2.4.18
MYSQL 5.6
... View more
Feature request from SamTay, posted on GitHub Apr 13, 2016
Product::isInStock is misleading. This does not check if product is in stock, but just checks if enabled.
Product::getQty does not look for qty key in the correct place. Perhaps in some parts of the app, qty is set on the Product::_data array directly, but my screenshot shows that this is not the case in the product/price/amount/default.phtml template. Because this is the implementation of the SaleableInterface, this is a problem for abstraction.
... View more
Feature request from leoquijano, posted on GitHub May 18, 2016
While implementing a custom theme using Magento 2, I found out that there's currently no support for easy customization of Add to Cart message texts.
In the Magento\Checkout\Controller\Cart\Add class, the following method is called to add a product to the cart:
/**
* Add product to shopping cart action
*
* @return \Magento\Framework\Controller\Result\Redirect
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function execute()
{
if (!$this->_formKeyValidator->validate($this->getRequest())) {
return $this->resultRedirectFactory->create()->setPath('*/*/');
}
$params = $this->getRequest()->getParams();
try {
if (isset($params['qty'])) {
$filter = new \Zend_Filter_LocalizedToNormalized(
['locale' => $this->_objectManager->get('Magento\Framework\Locale\ResolverInterface')->getLocale()]
);
$params['qty'] = $filter->filter($params['qty']);
}
$product = $this->_initProduct();
$related = $this->getRequest()->getParam('related_product');
/**
* Check product availability
*/
if (!$product) {
return $this->goBack();
}
$this->cart->addProduct($product, $params);
if (!empty($related)) {
$this->cart->addProductsByIds(explode(',', $related));
}
$this->cart->save();
/**
* @todo remove wishlist observer \Magento\Wishlist\Observer\AddToCart
*/
$this->_eventManager->dispatch(
'checkout_cart_add_product_complete',
['product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse()]
);
if (!$this->_checkoutSession->getNoCartRedirect(true)) {
if (!$this->cart->getQuote()->getHasError()) {
$message = __(
'You added %1 to your shopping cart.',
$product->getName()
);
$this->messageManager->addSuccessMessage($message);
}
return $this->goBack(null, $product);
}
} catch (\Magento\Framework\Exception\LocalizedException $e) {
if ($this->_checkoutSession->getUseNotice(true)) {
$this->messageManager->addNotice(
$this->_objectManager->get('Magento\Framework\Escaper')->escapeHtml($e->getMessage())
);
} else {
$messages = array_unique(explode("\n", $e->getMessage()));
foreach ($messages as $message) {
$this->messageManager->addError(
$this->_objectManager->get('Magento\Framework\Escaper')->escapeHtml($message)
);
}
}
$url = $this->_checkoutSession->getRedirectUrl(true);
if (!$url) {
$cartUrl = $this->_objectManager->get('Magento\Checkout\Helper\Cart')->getCartUrl();
$url = $this->_redirect->getRedirectUrl($cartUrl);
}
return $this->goBack($url);
} catch (\Exception $e) {
$this->messageManager->addException($e, __('We can\'t add this item to your shopping cart right now.'));
$this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e);
return $this->goBack();
}
}
It can be seen here two particular places where messages are hardwired. The first one is the success message:
$message = __(
'You added %1 to your shopping cart.',
$product->getName()
);
$this->messageManager->addSuccessMessage($message);
The second one is the error message:
} catch (\Exception $e) {
$this->messageManager->addException($e, __('We can\'t add this item to your shopping cart right now.'));
$this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e);
return $this->goBack();
}
Some websites require different copy for the Add to Cart behavior (both for success and error messages), so ideally theme developers should be able to customize that behavior. While the optimal approach would be to configure this in layout or template files, I think that a relatively simple solution is refactoring the Controller code, like this:
if (!$this->cart->getQuote()->getHasError()) {
$message = $this->getSuccessMessage($product);
$this->messageManager->addSuccessMessage($message);
}
} catch (\Exception $e) {
$this->messageManager->addException($e, $this->getErrorMessage());
$this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e);
return $this->goBack();
}
/**
* Gets the message used when a product is successfully added to the cart.
* @param $product
* @return \Magento\Framework\Phrase
*/
protected function getSuccessMessage($product)
{
return __(
'You added %1 to your shopping cart.',
$product->getName()
);
}
/**
* Gets the message used when there's a problem adding an item to the cart.
* @return \Magento\Framework\Phrase
*/
protected function getErrorMessage()
{
return __('We can\'t add this item to your shopping cart right now.');
}
This would allow theme developers to override this controller without overriding the main execute method, which can be risky and has a higher maintenance cost.
... View more