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

The link “Back to previous page” leads back to a different page than the one I came from. #3662

Open
max951 opened this issue Apr 25, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@max951
Copy link

max951 commented Apr 25, 2024

In the day view I select a date, let's say 28.04.2024 and click on an event to read the details.
If I then use the “Return to previous page” link, it takes me back to a different date. But that doesn't always happen.
The behavior occurs in Chrome and Firefox.

To illustrate this, I have published a video online in which the process can be seen.

I am using MRBS 1.11.4

@max951 max951 added the bug Something isn't working label Apr 25, 2024
@campbell-m
Copy link
Contributor

I'm afraid I can't reproduce this. Does it still happen on MRBS 1.11.5? Also, what have you got $auth['type'] and $auth['session'] set to (the answers will be on the Help page if you log in to MRBS as an admin)?

@max951
Copy link
Author

max951 commented Apr 26, 2024

Unfortunately I do not have the resources available at the moment to update to MRBS 1.11.5.

In the file view_entry.php the line
$referrer = session()->getReferrer();
returns the incorrect referrer.

The following workaround seems to work at the moment:

#$referrer = session()->getReferrer();
$referrer = $server['HTTP_REFERER'] ?? null;

@campbell-m
Copy link
Contributor

OK. What have you got $auth['type'] and $auth['session'] set to (the answers will be on the Help page if you log in to MRBS as an admin)?

@campbell-m
Copy link
Contributor

The following workaround seems to work at the moment:

Yes, but it could create other problems which $referrer = session()->getReferrer(); was used to solve.

@max951
Copy link
Author

max951 commented Apr 26, 2024

Thank you very much for your time.

Oh, sorry, I forgot:

This is my config

MRBS version	MRBS 1.11.4
Databankschemaversion	82
Versions des lokalen Databankschemas	1
$auth['type']	dgfc
$auth['session']	php

This is my auth-file: (I have attached '.txt' to be able to upload the file)
AuthDgfc.php.txt

@campbell-m
Copy link
Contributor

Thanks. Could you please

  1. Check your PHP error log to see if you are getting any error messages when this problem happens.
  2. Check your browser console for errors using your browser's developer tools.

@campbell-m
Copy link
Contributor

By the way, you could simply your AuthDgfc.php code by extending AuthDbExt rather than AuthDb:

namespace MRBS\Auth;


class AuthDgfc extends AuthDbExt
{
  private $db_moreconditions;
  
  public function __construct()
  {
    global $auth;
    
    parent::__construct();
    $this->db_moreconditions = $auth['db_ext']['db_moreconditions']; 
  }
  
  public function validateUser(
    #[\SensitiveParameter]
    ?string $user,
    #[\SensitiveParameter]
    ?string $pass)
  {
    // Your existing code here
  }
  
}

That way you can (a) cut down the amount of duplicated code and (b) benefit from enhancements and bug fixes to the duplicated code.

campbell-m added a commit that referenced this issue Apr 27, 2024
@campbell-m
Copy link
Contributor

I've now separted some of the code in validateUser() so that in future releases of MRBS you can simplify your class still further.

@max951
Copy link
Author

max951 commented Apr 28, 2024

Thank you very much for your advice and your extensive work.

Unfortunately I can't find any hints about the behavior neither in the console nor in the PHP log. see screenshots

hc_126
hc_127

villeristi pushed a commit to villeristi/rks-calendar that referenced this issue Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants