Closed
Description
Preconditions (*)
- Magento 2.2
- Magento 2.3.0
Steps to reproduce (*)
- I need to add a column after Links Title column programatically.
- I have created a plugin of
\Magento\Downloadable\Ui\DataProvider\Product\Form\Modifier\Links::modifyMeta()
namespace Webkul\Test\Plugin\Magento\Downloadable\Ui\DataProvider\Product\Form\Modifier;
use Magento\Catalog\Model\Locator\LocatorInterface;
use Magento\Downloadable\Ui\DataProvider\Product\Form\Modifier\Composite;
use Magento\Framework\Stdlib\ArrayManager;
use Magento\Ui\Component\Container;
use Magento\Ui\Component\Form;
/**
* Links class
*/
class Links
{
/**
*
* @param \Webkul\Test\Helper\Data $helper
*/
public function __construct(
LocatorInterface $locator,
ArrayManager $arrayManager,
\Webkul\Test\Helper\Data $helper
) {
$this->helper = $helper;
$this->locator = $locator;
$this->arrayManager = $arrayManager;
}
/**
* @see \Magento\Downloadable\Ui\DataProvider\Product\Form\Modifier\Links::modifyMeta()
*/
public function afterModifyMeta (
\Magento\Downloadable\Ui\DataProvider\Product\Form\Modifier\Links $subject,
$result
) {
$recordPath = $this->arrayManager->findPath('record', $result, null, 'children');
$result = $this->arrayManager->merge(
$recordPath.'/children',
$result,
array_merge(
[
'resolution' => $this->getResolutionColumn()
]
)
);
return $result;
}
/**
* @return array
*/
protected function getResolutionColumn()
{
$titleContainer['arguments']['data']['config'] = [
'componentType' => Container::NAME,
'formElement' => Container::NAME,
'component' => 'Magento_Ui/js/form/components/group',
'label' => __('Resolution'),
'showLabel' => false,
'dataScope' => '',
'sortOrder' => 15,
];
$titleField['arguments']['data']['config'] = [
'formElement' => Form\Element\Input::NAME,
'componentType' => Form\Field::NAME,
'dataType' => Form\Element\DataType\Text::NAME,
'dataScope' => 'resolution',
'validation' => [
'required-entry' => true,
],
];
return $this->arrayManager->set('children/resolution', $titleContainer, $titleField);
}
}
- After applying this code with sortOrder 15 on this custom column the links table columns misplaced
Expected result (*)
- This custom column must be insert after Title Column
Actual result (*)
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.2 release lineThe issue has been fixed in 2.3 release lineGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.3 release