Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add events to add fields in tab form #405

Closed
ihor-sviziev opened this issue Nov 7, 2013 · 11 comments
Closed

Add events to add fields in tab form #405

ihor-sviziev opened this issue Nov 7, 2013 · 11 comments

Comments

@ihor-sviziev
Copy link
Contributor

For now we have a lot places, that contains code like this:

/** @var \Magento\Data\Form $form */
$form = $this->_formFactory->create();
$fieldset = $form->addFieldset('tiered_price', array('legend' => __('Tier Pricing')));

$fieldset->addField('default_price', 'label', array(
    'label' => __('Default Price'),
    'title' => __('Default Price'),
    'name'  => 'default_price',
    'bold'  => true,
    'value' => $product->getPrice()
));

But we haven't events to add additional fields.

Example:

$fieldset = $form->addFieldset('cache_enable', array(

@kandy
Copy link
Contributor

kandy commented Nov 7, 2013

You can use interceptors on setForm to implement this.

@ghost ghost assigned elenleonova Dec 3, 2013
@verklov
Copy link
Contributor

verklov commented Dec 27, 2013

@igor-svizev ,
Did you try the approach suggested by @kandy ? If yes, did this resolve the issue that you had?

@ihor-sviziev
Copy link
Contributor Author

@kandy , could you provide example how to make it?

@verklov
Copy link
Contributor

verklov commented Jan 3, 2014

@igor-svizev , we will file this issue to our internal bug tracker. Thank you for reporting this to us!

@maksek
Copy link
Contributor

maksek commented Jan 8, 2015

What going to be use-case with events? It seems like much easier to create new block and configure layout to use it.

@ihor-sviziev
Copy link
Contributor Author

@maksek how I can add new fields to existing forms, as example if my module will add some field to admin user form?

@kandy
Copy link
Contributor

kandy commented Jan 9, 2015

You can define "before" plugin on $this->setForm($form) method of block and get $form as arguments, and change form as you need.

@antonkril
Copy link
Contributor

@kandy this approach will work, but I think here we need an explicit extension point, same as for addTab

magento-team pushed a commit that referenced this issue Jul 3, 2015
[EPAM] Import/Export sprint #4
@tzyganu
Copy link
Contributor

tzyganu commented Jul 11, 2016

Should this still be open if the tendency is to move to UI components for admin forms?

@vkorotun
Copy link
Contributor

vkorotun commented Aug 4, 2016

@tzyganu Very good question. Since we have a couple alternative options to add fields to old forms without explicit event, and taking into account that we are moving to UI Components for admin forms, it is reasonable to close this issue.

@ihor-sviziev
Copy link
Contributor Author

I think this issue can be closed

mmansoor-magento pushed a commit that referenced this issue Sep 20, 2016
Bug
MAGETWO-56699 [GITHUB] Paypal checkout not possible with products that have custom options #5938 - for mainline
MAGETWO-58290 [Github]Empty product option is added on each PUT request #5963
MAGETWO-58136 [Github] Shipping and billing address are not set if order placed with payment action Sale #6438
MAGETWO-55608 [GITHUB] M2.1: Not scrollable picture on mobile / product page #5302
MAGETWO-58285 Ajax error message doesn't display in backend
MAGETWO-58338 [Github]Problem adding attribute options that start with a number via REST Api #5715
MAGETWO-52575 Unable to apply free shipping to specified method when creating order in admin
MAGETWO-57078 [GITHUB] Can't set customer group when creating a new order in the admin. #6162
MAGETWO-58039 Table rate shipping not applying correctly - for mainline
magento-engcom-team pushed a commit that referenced this issue Mar 1, 2019
… Required parameter "shipping_carrier_code" is missin #405
magento-engcom-team added a commit that referenced this issue Mar 1, 2019
…ed instead of Required parameter 'shipping_carrier_code' is missin #405

 - Merge Pull Request magento/graphql-ce#405 from XxXgeoXxX/graphql-ce:2.3-develop#400
 - Merged commits:
   1. 0ae6146
   2. 86857b3
   3. 63f4cfb
   4. 2f3fdc3
magento-engcom-team pushed a commit that referenced this issue Mar 1, 2019
…ed instead of Required parameter "shipping_carrier_code" is missin #405
magento-devops-reposync-svc pushed a commit that referenced this issue May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants