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

Bug: Cannot delete single relationship from content #249

Open
mshick opened this issue Dec 21, 2015 · 2 comments
Open

Bug: Cannot delete single relationship from content #249

mshick opened this issue Dec 21, 2015 · 2 comments

Comments

@mshick
Copy link

mshick commented Dec 21, 2015

Cross-posting this bug from the forums:

http://forums.webhook.com/t/bug-cannot-delete-single-relationship-from-content/849

Due to this bug I cannot use single-item relationships in the CMS, as they will not be truly modifiable by an end user. The work-around mentioned in that thread does work, but is not acceptable for a non-technical user.

I have a couple of relationship fields in a content type. They are set to "Only allow one searched item and no more." Every time I attempt to delete one of the relationships it is restored. No errors are reporting in the console, no edit locks exist, and the UI refreshes to appear that the relationship is gone, but upon a hard refresh it has returned. Here's the read out from my console:

Validating controls.
vendor.js:31681 -- name: ✓
vendor.js:31681 -- create_date: ✓
vendor.js:31681 -- last_updated: ✓
vendor.js:31681 -- hero_image: ✓
vendor.js:31681 -- hero_book: ✓
vendor.js:31681 -- hero_article: ✓
vendor.js:31681 -- hero_quote: ✓
vendor.js:31681 -- hero_quote_attribution: ✓
vendor.js:31681 -- preview_url: ✓
vendor.js:31681 -- slug: ✓
vendor.js:31681 Updating 2 reverse relationships.
vendor.js:31681 `hero_book` added 0 and removed 1 relationships
vendor.js:31681 `hero_book` wants to remove "homepage homepage" from `books -Jxg3sqqB9gYz3ssmlrS:homepage_hero_book`
vendor.js:31681 `hero_article` added 1 and removed 0 relationships
vendor.js:31681 `hero_article` wants to add "homepage homepage" to `articles -JxgCzi_VfYrxn9CfYx-:homepage_hero_article`
vendor.js:31681 SearchIndex::indexItem::books::The Invaders: A Novel
vendor.js:31681 SearchIndex::indexItem::articles::Bien Cuit, A Delicious Book Release
vendor.js:31681 `hero_book` updated `The Invaders: A Novel:homepage_hero_book` to `[]`.
vendor.js:31681 `hero_article` updated `Bien Cuit, A Delicious Book Release:homepage_hero_article` to `[homepage homepage]`.
vendor.js:31681 Extracting data from 10 controls.
vendor.js:31681 textfield:name
vendor.js:31681 Homepage
vendor.js:31681 datetime:create_date
vendor.js:31681 2015-08-27T18:38:00-04:00
vendor.js:31681 datetime:last_updated
vendor.js:31681 2015-08-28T10:31:00-04:00
vendor.js:31681 image:hero_image
vendor.js:31681 {
  "height": 728,
  "resize_url": "http://lh3.googleusercontent.com/_R-1IPW5pA5bbAWRn1B5kEgI-WJjo06Rjl1f3Gev8qEBCbx0z8c-hOPGd5M4Biyx5cJEVgf4N_u9mHS2ETcU1tMG7yN38g",
  "size": 1264401,
  "type": "image/png",
  "url": "/webhook-uploads/1440715201376/invaders%20home%20hero.png",
  "width": 1326
}
vendor.js:31681 relation:hero_book
vendor.js:31681 undefined
vendor.js:31681 relation:hero_article
vendor.js:31681 articles -JxgCzi_VfYrxn9CfYx-
vendor.js:31681 wysiwyg:hero_quote
vendor.js:31681 undefined
vendor.js:31681 textfield:hero_quote_attribution
vendor.js:31681 undefined
vendor.js:31681 textfield:preview_url
vendor.js:31681 dbb7e258-1c04-93d0-123c-37ce9ce93b92
vendor.js:31681 textfield:slug
vendor.js:31681 undefined
vendor.js:31681 SearchIndex::indexItem::homepage::Homepage
vendor.js:31681 Sending build signal:No publish date.

You can see the update made to hero_book,

`hero_book` updated `The Invaders: A Novel:homepage_hero_book` to `[]`.

So everything seems to have registered properly.

It is also worth noting that if I allow more than one relationship in the field I can delete and empty out the relationships as normal / as you would expect.

Here is a screen recording, showing exactly what happens.

Big blocker on a current project, so hopefully this is an easy fix? Thanks!

@kenzik
Copy link

kenzik commented Dec 22, 2015

@gpbmike @snide et.all - I can confirm this bug. I've encountered this behavior in the past. If you can't get to it in short order and want to point me in the right direction I can try to get a PR submitted for your review.

@mshick - Your video is a 404.

@mshick
Copy link
Author

mshick commented Dec 29, 2015

@dkenzik updated link

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

2 participants