mobile error 500 if a reshared (original) post will be deleted.
This commit is contained in:
parent
3e15835386
commit
795a7a5751
3 changed files with 7 additions and 1 deletions
|
|
@ -37,6 +37,7 @@
|
||||||
* Fix mobile search tags [#4392](https://github.com/diaspora/diaspora/issues/4392)
|
* Fix mobile search tags [#4392](https://github.com/diaspora/diaspora/issues/4392)
|
||||||
* Remove placeholders for name fields in settings (no more Sofaer) [#4385](https://github.com/diaspora/diaspora/pull/4385)
|
* Remove placeholders for name fields in settings (no more Sofaer) [#4385](https://github.com/diaspora/diaspora/pull/4385)
|
||||||
* Problems with layout the registration page for mobile. [#4396](https://github.com/diaspora/diaspora/issues/4396)
|
* Problems with layout the registration page for mobile. [#4396](https://github.com/diaspora/diaspora/issues/4396)
|
||||||
|
* Fix mobile view of deleted reshares [#4397](https://github.com/diaspora/diaspora/issues/4397)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
* Admin: add option to find users under 13 (COPPA) [#4252](https://github.com/diaspora/diaspora/pull/4252)
|
* Admin: add option to find users under 13 (COPPA) [#4252](https://github.com/diaspora/diaspora/pull/4252)
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ module MobileHelper
|
||||||
if (post.public? || reshare?(post)) && (user_signed_in? && post.author != current_user.person)
|
if (post.public? || reshare?(post)) && (user_signed_in? && post.author != current_user.person)
|
||||||
absolute_root = reshare?(post) ? post.absolute_root : post
|
absolute_root = reshare?(post) ? post.absolute_root : post
|
||||||
|
|
||||||
if absolute_root.author != current_user.person
|
if absolute_root && absolute_root.author != current_user.person
|
||||||
reshare = Reshare.where(:author_id => current_user.person_id,
|
reshare = Reshare.where(:author_id => current_user.person_id,
|
||||||
:root_guid => absolute_root.guid).first
|
:root_guid => absolute_root.guid).first
|
||||||
klass = reshare.present? ? "active" : "inactive"
|
klass = reshare.present? ? "active" : "inactive"
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ Feature: resharing from the mobile
|
||||||
| Alice Smith | alice@alice.alice |
|
| Alice Smith | alice@alice.alice |
|
||||||
| Eve Doe | eve@eve.eve |
|
| Eve Doe | eve@eve.eve |
|
||||||
And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
|
And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
|
||||||
|
And a user with email "eve@eve.eve" is connected with "bob@bob.bob"
|
||||||
Given "bob@bob.bob" has a public post with text "reshare this!"
|
Given "bob@bob.bob" has a public post with text "reshare this!"
|
||||||
And I sign in as "alice@alice.alice"
|
And I sign in as "alice@alice.alice"
|
||||||
|
|
||||||
|
|
@ -41,3 +42,7 @@ Feature: resharing from the mobile
|
||||||
And I sign in as "bob@bob.bob"
|
And I sign in as "bob@bob.bob"
|
||||||
And I toggle the mobile view
|
And I toggle the mobile view
|
||||||
Then I should see "Original post deleted by author." within ".reshare"
|
Then I should see "Original post deleted by author." within ".reshare"
|
||||||
|
And I log out
|
||||||
|
And I sign in as "eve@eve.eve"
|
||||||
|
And I toggle the mobile view
|
||||||
|
Then I should see "Original post deleted by author." within ".reshare"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue