Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BB-22832: Multifile attribute is shown on product visibility page in …
…back-office - 5.1 (#36428)
- Loading branch information
1 parent
e11920b
commit 41c5264
Showing
8 changed files
with
452 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/Oro/Bundle/ProductBundle/EventListener/ProductMultiFileBlockListener.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace Oro\Bundle\ProductBundle\EventListener; | ||
|
||
use Oro\Bundle\UIBundle\Event\BeforeFormRenderEvent; | ||
|
||
/** | ||
* Stops adding additional fields or attributes to forms if they are on the specified pages | ||
*/ | ||
class ProductMultiFileBlockListener | ||
{ | ||
private array $pages = []; | ||
|
||
public function setPages(array $pages): void | ||
{ | ||
$this->pages = $pages; | ||
} | ||
|
||
public function onBeforeFormRender(BeforeFormRenderEvent $event): void | ||
{ | ||
if (in_array($event->getPageId(), $this->pages)) { | ||
$event->stopPropagation(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.