Error 'Attempt to update read-only object'

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Error 'Attempt to update read-only object'

KlausK-2
Hi,
I tried to "import view" in the view composer. The stored view is out of a
Version 5.1.4.
The view to import contains a "MultipleSelectionListView" with some
colums. The import stops at doing the getContentsBlock "[ :each | each id
]" with that error message above.
A "CompiledExpression isImmutable inspect" returns false.

Is there any way to get my views into version 6?

Cheers
Klaus

----------------------------------------------------------------------------------------------------

11:43:06, 24 November 2005: Unhandled exception - a RaisedSignal('Attempt
to update read-only object')

Signal>>signalWith:
CompiledExpression(Object)>>errorAt:put:
CompiledExpression(Object)>>at:put:
BlockClosure class>>attemptToUpgradeBlock:data:
[] in BlockClosure class>>stbConvertFrom:
STBInFiler>>readObjectOfClass:format:
BlockClosure class(ClassDescription)>>stbReadFrom:format:
STBInFiler>>readObjectOfClass:
STBInFiler>>basicNext
STBInFiler>>readObjectOfClass:format:
ListViewColumn class(ClassDescription)>>stbReadFrom:format:
STBInFiler>>readObjectOfClass:
STBInFiler>>basicNext
STBInFiler>>readObjectOfClass:format:
Array class(ClassDescription)>>stbReadFrom:format:
STBInFiler>>readObjectOfClass:
STBInFiler>>basicNext
STBInFiler>>readObjectOfClass:format:
STBCollectionProxy class(ClassDescription)>>stbReadFrom:format:
STBInFiler>>readObjectOfClass:
----------------------------------------------------------------------------------------------------


Reply | Threaded
Open this post in threaded view
|

Re: Error 'Attempt to update read-only object'

Andy Bower-3
KlausK,

> I tried to "import view" in the view composer. The stored view is out
> of a Version 5.1.4.
> The view to import contains a "MultipleSelectionListView" with some
> colums. The import stops at doing the getContentsBlock "[ :each |
> each id ]" with that error message above.
> A "CompiledExpression isImmutable inspect" returns false.
>
> Is there any way to get my views into version 6?

It is our intention that nearly all views will load directly into D6.
That said, I think your view load is failing because of an attempt to
upgrade from one block version to another. Without your view in front
of me I can't test this but try replacing (save/backup your image
first):

---

BlockClosure class>>attemptToUpgradeBlock: aBlockClosure data: data
        | recompiledBlock newMethod |
        recompiledBlock := self attemptToRecompile: aBlockClosure.
        recompiledBlock isClean ifFalse: [^recompiledBlock].

        "Danger Will Robinson: If the new block is clean, then it will be
referenced from the literal frame of its home method.
        When the STBInFiler #become:s the array with the answer to swap the
refs, the array of old vars will end up
        stored in the literal frame as useless junk that we don't want,
therefore we pre-emptively replace the ref from
        the literal frame with the array so that it is all correct when
swapped [my brain exploded before I understood that, Ed]"
        newMethod := recompiledBlock method.
        newMethod whileMutableDo: [
        1 to: newMethod literalCount
                do: [:i | (newMethod at: i) == recompiledBlock ifTrue: [newMethod at:
i put: data]]].
        ^recompiledBlock

---

Try loading the errant view again. If this works then let me know and
will include this change in the first patch release. If it doesn't work
then returned your backup image and e-mail me the view in question and
I will take a more detailed look.

Best regards,

Andy Bower
Dolphin Support


Reply | Threaded
Open this post in threaded view
|

Re: Error 'Attempt to update read-only object'

KlausK-2
Andy,
thanks a lot for answering quickly.

Your patch worked well. The view looks fine now.

Cheers
Klaus