EasyAdminBundle icon indicating copy to clipboard operation
EasyAdminBundle copied to clipboard

Deprecate AdminContext->getReferrer()

Open KDederichs opened this issue 1 year ago • 6 comments

Describe the bug With the merge of https://github.com/EasyCorp/EasyAdminBundle/pull/6105 referrer is not a thing anymore, but AdminContext's getReferrer method doesn't reflect this.

When calling getReferrer it should also trigger a deprecation, at least.

Though I'd almost argue the removal was a BC break cause it changes behavior on the dev's end when they use it for redirection after custom actions for example. (That's the issue I have atm)

To Reproduce Admin version 4.8.11

(OPTIONAL) Additional context If they are useful, include logs, code samples, screenshots, etc.

KDederichs avatar Jan 25 '24 14:01 KDederichs

Same issue here too, with custom actions... Fixed by replacing

return $this->redirect($context->getReferrer());

with

return $this->redirect($context->getRequest()->headers->get('referer'));

birkof avatar Jan 26 '24 09:01 birkof

Same issue and unfortunately need to downgrade to the 4.8.10 version due to the BC break with the function getReferrer() that does not exist anymore and that is a lot of used in my project.

Can you reintroduce this function please with a depreciate notice ?

Thanks

wehostadm avatar Jan 29 '24 19:01 wehostadm

Yes, this was very stupid idea to introduce this breaking change.

On my project we have a lot of custom actions for Crud::PAGE_EDIT, that should return to that PAGE_EDIT, but it doesn't work anymore and Action::new(...) object doens't have option to includeReferer()

MikaBeDev avatar Feb 23 '24 13:02 MikaBeDev

Same problem for me, it is shame to have introduce a BC break, I think hundreds of projects are impacted by that. I don't understand why @javiereguiluz does not want to reintroduce this with a depreciate notice as all open source bundles do...

Need to lock to the version 4.8.9 and was searching for another bundle unless this bug is fixed. I cannot lost same days to change all my code in the whole project that is really big :( Prefer to have a new fresh start with a new bundle if needed

It is a shame because this bundle is really good but this feature is not a feature : it is a BC break with no warning to end users

fdiedler avatar Mar 05 '24 11:03 fdiedler

We also had issues regarding the referrer changes in 4.x in general, mostly in regards to context-aware redirects.

pkly avatar Mar 18 '24 14:03 pkly

I recently ugraded easyadmin version from 4.8.6 to 4.10.2.

I have the problem that I can no longer return to my dashboard after i use the CREATE / EDIT (form) SAVE_AND_RETURN buttons from there.

Could one use the following alternative to get rid of the deprecation entries: Instead of using the .includeReferrer() feature, in this case i manually pass the referrer via the url

<a class="dropdown-item action-detail" href="{{ ea_url({'entityFqcn': entityFqcn, 'referrer': app.request.uri})
    .setController(...)
    .setAction('edit')
    .setEntityId(entity.id)
    }}" data-action-name="detail">
    <span class="action-label">{{ 'l.edit'|trans }}</span>
</a>

'referrer': app.request.uri

What you think, is this approach suitable to fix my problem?

pfpro avatar Jun 13 '24 13:06 pfpro