Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

$this->flashmessenger()->getMessages() got error : "Container cannot write to storage due to type mismatch" for 2.1.1 #3700

Closed
samsonasik opened this issue Feb 7, 2013 · 9 comments

Comments

@samsonasik
Copy link
Contributor

When I use $this->flashmessenger()->getMessages() for 2.1.1 there is error :

Container cannot write to storage due to type mismatch

in

/Users/abdulmalikikhsan/www/zf21_learn/vendor/zendframework/zendframework/library/Zend/Session/AbstractContainer.php:202

It just work for 2.1.0

@mwillbanks
Copy link
Contributor

I am looking into this; not quite certain why it is happening yet; but diagnosing it none the less.

@mwillbanks
Copy link
Contributor

I believe that this was due to a session that was previously created; all new sessions should not show this issue. This is because the contract for session containers used to require an array or an instanceof an ArrayObject; now it is an array or an instance of a Zend\Stdlib\ArrayObject. I believe that we can make a change to allow anything that is Traversable that does not have any harmful side effects.

@mwillbanks
Copy link
Contributor

@weierophinney please let me know if this is something we should do... might cause people already with production apps to have to reset all of their sessions 👎

@samsonasik
Copy link
Contributor Author

Oops, there is my old session, issue closed. sorry ;)

@mwillbanks
Copy link
Contributor

It would actually be good to keep this issue open as it is more or less an upgrade bug.

@pawelnowak
Copy link

Hello there,

I'm struggling with the same issue - after updating to 2.1.1 my application stopped working. How do I approach this without editing the ZF's code? Should I start retrieving my flash messages in a different way?

@mwillbanks
Copy link
Contributor

@pawelnowak without editing ZF's code; remove all php sessions and force them to recreate a session. There is a fix in progress; I have a working branch but it has to execute it's unit tests as well as be reviewed.

@samsonasik samsonasik reopened this Feb 7, 2013
@samsonasik
Copy link
Contributor Author

@mwillbanks ok, i re-open it

@pawelnowak
Copy link

@mwillbanks, your solution worked, thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants