-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Proxy code generation does not generate classes #35252
Comments
Hi @DmitryFurs. Thank you for your report.
Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
For more details, review the Magento Contributor Assistant documentation. Add a comment to assign the issue: To learn more about issue processing workflow, refer to the Code Contributions.
🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket. ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
Hi @engcom-Charlie. Thank you for working on this issue.
|
Hi @engcom-Hotel. Thank you for working on this issue.
|
Hello @DmitryFurs, Thanks for the report and collaboration! We have tried to reproduce the issue in Magento 2.4-develop branch and followed the following steps to replicate the issue:-
Hence this issue is reproducible and confirmed. Thanks |
I can confirm that issue and I can add that Magento must be in production mode or must be without installation (eg. config.php is present but env.php is not). Im using this configuration for generate classes before create classmap optimization and now its causes error. Im counting on fast fix |
We also started noticing this isuee. I created Pull Request that fixes this issue #37434 |
✅ Jira issue https://jira.corp.adobe.com/browse/AC-9388 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-Echo. Thank you for verifying the issue. |
Preconditions (*)
Steps to reproduce (*)
etc/adminhtml/di.xml
with content in which the proxy arguments have line breaks at the endsetup:di:compile
commandAmasty\Oaction\Model\Action\Modifier\OrderAttributesModifier\Proxy
andAmasty\Oaction\Model\Action\Modifier\PrintPackingSlipsModifier\Proxy
generated/metadata/adminhtml.php
contentExpected result (*)
Actual result (*)
Discovery
When production mode is set, code generation is performed only during
setup:di:compile
.After code generation, Proxy and Factory files are missing because \Magento\Setup\Module\Di\Code\Scanner\XmlScanner::collectEntities() and \Magento\Setup\Module\Di\Code\Scanner\XmlScanner::scanFactories() use not quite correct regular expressions that want to meet the value without extra whitespace characters after Proxy and Factory
At the same time, these arguments were successfully added to the metadata file
generated/metadata/adminhtml.php
If you use developer mode, then after compiling di, there is also no proxy files, but when accessing the website, these classes are generated on the fly, which avoids errors.
Most likely, this problem can be fixed by changing regexp, which will allow you to use whitespace characters at the end, or by replacing this regulatory expression with a suitable xpath expression.
$regex = '/^(.*)\\\(.*)Proxy$/';
->$regex = '/^(.*)\\\(.*)Proxy(\s*)$/';
$regex = '/^(.*)Factory$/';
->$regex = '/^(.*)Factory(\s*)$/';
When I reformat
di.xml
without line breaks, then everything starts working correctly.From
To
But the use of line breaks in the arguments is not prohibited in any way
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
The text was updated successfully, but these errors were encountered: