mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-11-04 14:46:19 +08:00 
			
		
		
		
	Fixes #15791: Added a warning when the form names conflict
This commit is contained in:
		
				
					committed by
					
						
						Alexander Makarov
					
				
			
			
				
	
			
			
			
						parent
						
							9a3b3a759b
						
					
				
				
					commit
					a953e7e423
				
			@ -4,6 +4,7 @@ Yii Framework 2 Change Log
 | 
				
			|||||||
2.0.16 under development
 | 
					2.0.16 under development
 | 
				
			||||||
------------------------
 | 
					------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Bug #15791: Added a warning when the form names conflict (s1lver, rustamwin)
 | 
				
			||||||
- Enh #16151: `ActiveQuery::getTableNameAndAlias()` is now protected (s1lver)
 | 
					- Enh #16151: `ActiveQuery::getTableNameAndAlias()` is now protected (s1lver)
 | 
				
			||||||
- Bug #16657: Ensure widgets after run event result contains the result of the rendered widget (AdeAttwood)
 | 
					- Bug #16657: Ensure widgets after run event result contains the result of the rendered widget (AdeAttwood)
 | 
				
			||||||
- Bug #14230: Fixed `itemsOptions` ignored in `checkBoxList` (s1lver)
 | 
					- Bug #14230: Fixed `itemsOptions` ignored in `checkBoxList` (s1lver)
 | 
				
			||||||
 | 
				
			|||||||
@ -160,7 +160,18 @@ window.yii = (function ($) {
 | 
				
			|||||||
                pjax = $e.data('pjax'),
 | 
					                pjax = $e.data('pjax'),
 | 
				
			||||||
                usePjax = pjax !== undefined && pjax !== 0 && $.support.pjax,
 | 
					                usePjax = pjax !== undefined && pjax !== 0 && $.support.pjax,
 | 
				
			||||||
                pjaxContainer,
 | 
					                pjaxContainer,
 | 
				
			||||||
                pjaxOptions = {};
 | 
					                pjaxOptions = {},
 | 
				
			||||||
 | 
					                conflictParams = ['submit', 'reset', 'elements', 'length', 'name', 'acceptCharset',
 | 
				
			||||||
 | 
					                    'action', 'enctype', 'method', 'target'];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // Forms and their child elements should not use input names or ids that conflict with properties of a form,
 | 
				
			||||||
 | 
					            // such as submit, length, or method.
 | 
				
			||||||
 | 
					            $.each(conflictParams, function (index, param) {
 | 
				
			||||||
 | 
					                if (areValidParams && params.hasOwnProperty(param)) {
 | 
				
			||||||
 | 
					                    console.error("Parameter name '" + param + "' conflicts with a same named form property. " +
 | 
				
			||||||
 | 
					                        "Please use another name.");
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (usePjax) {
 | 
					            if (usePjax) {
 | 
				
			||||||
                pjaxContainer = $e.data('pjax-container');
 | 
					                pjaxContainer = $e.data('pjax-container');
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user