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

FIX: Don’t copy ID from target page on write #13

Merged
merged 1 commit into from
Sep 23, 2015

Conversation

kinglozzer
Copy link
Contributor

Changes in DataObject::write() for 3.2 highlighted this issue.

DataObject::write() uses isInDB() which will check for an ID. If adding a new menu item, the ID is not set and it will be copied from the target page, resulting in SilverStripe trying to write to a row with the page’s ID instead of creating a new row.

This didn’t happen in 3.1 because DataObject::write() would access $this->record['ID'] directly, bypassing __get().

camspiers added a commit that referenced this pull request Sep 23, 2015
FIX: Don’t copy ID from target page on write
@camspiers camspiers merged commit 9011cc9 into WPP-Public:master Sep 23, 2015
@camspiers
Copy link
Contributor

Nice catch @kinglozzer thanks!

@camspiers
Copy link
Contributor

@stecman can you manage the release for this fix?

@kinglozzer kinglozzer deleted the patch-1 branch September 23, 2015 15:26
@stecman
Copy link
Contributor

stecman commented Sep 28, 2015

Released as 2.1.3. Thanks!

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

Successfully merging this pull request may close these issues.

3 participants