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

getFullActionName() returns __ on CMS & Category Pages #35594

Closed
5 tasks
MagePsycho opened this issue Jun 9, 2022 · 10 comments
Closed
5 tasks

getFullActionName() returns __ on CMS & Category Pages #35594

MagePsycho opened this issue Jun 9, 2022 · 10 comments
Assignees
Labels
Issue: needs update Additional information is require, waiting for response Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@MagePsycho
Copy link
Contributor

MagePsycho commented Jun 9, 2022

Preconditions and environment

  • Magento 2.4.4
  • FPC enabled
  • Observe the event controller_action_predispatch

Steps to reproduce

  1. Observe the event controller_action_predispatch in app/code/Vendor/Module/etc/frontend/events.xml.
    And observer looks like
public function execute(Observer $observer)
{
    $request = $observer->getEvent()->getRequest();
    $fullActionName = $request->getFullActionName();
    file_put_contents(BP . '/var/log/http.log', $fullActionName . PHP_EOL, FILE_APPEND | LOCK_EX);
    // $fullActionName gives ___ value 
    // for CMS & Category pages (M2.4.4)
    // ...    
}
  1. Go to Homepage(/) or any CMS page, Example: /about-us

Expected result

$fullActionName should give cms_page_view

Actual result

$fullActionName is giving __

Additional information

No response

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented Jun 9, 2022

Hi @MagePsycho. Thank you for your report.
To speed up processing of this issue, make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

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:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 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

@m2-community-project m2-community-project bot added this to Ready for Confirmation in Issue Confirmation and Triage Board Jun 9, 2022
@engcom-Hotel engcom-Hotel added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Jun 9, 2022
@engcom-Hotel engcom-Hotel self-assigned this Jun 9, 2022
@m2-assistant
Copy link

m2-assistant bot commented Jun 9, 2022

Hi @engcom-Hotel. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Hotel
Copy link
Contributor

engcom-Hotel commented Jun 9, 2022

Hello @MagePsycho,

Thanks for the report and collaboration!

We have tried to reproduce the issue in Magento 2.4-develop branch, by following the below steps:

  1. Make some code changes to debug and add a breakpoint in file Http.php:
public function getFullActionName($delimiter = '_')
    {
        $full_action_name = $this->getRouteName() .
            $delimiter .
            $this->getControllerName() .
            $delimiter .
            $this->getActionName();
        return $full_action_name;
    }
  1. Trying to access the about-us page from the frontend.

As per our observation initially, when program execution breaks on the breakpoint we can see the value of variable $full_action_name is __, but after some more hits in the same request the value of that variable has been the expected one i.e. cms_page_view. Please refer to the below screencast for the reference:

35594-Compressed.mp4

But the page is rendering without any issue. We request you to tell us the use case in which you are not able to proceed further due to this.

Thanks

@MagePsycho
Copy link
Contributor Author

@engcom-Hotel

Try to observe the event controller_action_predispatch in app/code/Vendor/Module/etc/frontend/events.xml.

Where the observer may look like this, for example

public function execute(Observer $observer)
{
    $request = $observer->getEvent()->getRequest();
    $fullActionName = $request->getFullActionName();
    file_put_contents(BP . '/var/log/http.log', $fullActionName . PHP_EOL, FILE_APPEND | LOCK_EX);
    // $fullActionName gives ___ value 
    // for CMS & Category pages (M2.4.4)
    // ...    
}

And go to any CMS page, Example: /about-us (Make sure the FPC is enabled and you are visiting the page more than once)

You will always get the value as __

Note this also happens with the event controller_front_send_response_before

@engcom-Hotel
Copy link
Contributor

Hello @MagePsycho,

I have followed the same way. Please consider the screencast in this #35594 (comment). I need to ask about the use case where the functionality is breaking for you.

Thanks

@engcom-Hotel engcom-Hotel added the Issue: needs update Additional information is require, waiting for response label Jun 21, 2022
@m2-community-project m2-community-project bot moved this from Ready for Confirmation to Needs Update in Issue Confirmation and Triage Board Jun 21, 2022
@MagePsycho
Copy link
Contributor Author

It's working for the cms_page_view but not for cms_index_index (Homepage).
Can you please debug with the same approach for the Homepage (/)?

@engcom-Hotel
Copy link
Contributor

Hello @MagePsycho,

Thanks for the reply!

We have checked it for HomePage as well. But here also the issue is not reproducible for us. Please refer the below screencast for reference:

CompressedScreen.Recording.2022-06-28.at.4.47.32.PM.mp4

Please let us know if we have missed anything.

Thanks

@engcom-Hotel
Copy link
Contributor

Dear @MagePsycho,

We have noticed that this issue has not been updated for a period of 14 Days. Hence we assume that this issue is fixed now, so we are closing it. Please raise a fresh ticket or reopen this ticket if you need more assistance on this.

Regards

@MagePsycho
Copy link
Contributor Author

MagePsycho commented Jul 12, 2022

I just checked in Magento 2.4.4, If the homepage is cached, controller_action_predispatch is not triggered.
For event controller_front_send_response_before, it's returning __.

I would suggest reproducing the issue as follows:

  1. Observe the event controller_front_send_response_before on frontend area (etc/frontend/events.xml)
  2. Get the get full action name from the observer class as $fullActionName = $observer->getEvent()->getRequest()->getFullActionName()
  3. Reload the homepage for one more time (to make sure the page is cached now). If FPC is disabled, make sure to enable it.
  4. Now load the homepage and check the value of $fullActionName. It will always return __ (Please refer to the attached screenshot)
    image

@MagePsycho
Copy link
Contributor Author

FYI, a new issue has been created as the current one is closed - #35756

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: needs update Additional information is require, waiting for response Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
None yet
Development

No branches or pull requests

2 participants