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

p2 breathe – orphan comment breaks theme #188

Open
lowcountryp opened this issue Apr 21, 2020 · 0 comments
Open

p2 breathe – orphan comment breaks theme #188

lowcountryp opened this issue Apr 21, 2020 · 0 comments

Comments

@lowcountryp
Copy link

lowcountryp commented Apr 21, 2020

The p2 breathe theme with o2 plugin stops functioning properly in this scenario:

An authorized user ‘y’ (level=editor) adds a new user ‘x’ (level=contributor).
User ‘x’ signs on
User ‘x’ replies with comment to posts by ‘y’

At this point, the theme works fine, everything is showing as expected.

Here’s where it breaks:
User ‘x’ is deleted using either:
– wp_delete_user($id, $reassign); …or…
– Dashboard==>Users==>Delete (including the dialog to reassign)

In either method, the user is successfully removed.

BUT, it’s the ‘orphaned’ comment record that is disrupting the theme, and at that point:
=>The POST button spins off ‘o2 app not found’ messages, and
=>The console shows ‘TypeError: jsonifiedModel.userLogin is null’ message spelled below.

If the orphaned comment record is deleted, the theme functions normally.

I have verified this is the case with a vanilla WordPress / p2-breathe / o2 instance. I can provide a link / signon to the vanilla P2 theme site.

The comments.user_id value retains the original user ‘x’ user_id after the user deletion.

If comments.user_id is changed to a live user_id, the problem goes away and the theme works normally.

C O N S O L E :
The errors (2) below appear in the console. For the first one, the userLogin value and length are present up to line 375, but something happens to the userLogin value in ‘jsonification’ (jsonifiedModel = this.model.toJSON();

TypeError: jsonifiedModel.userLogin is nullcomment.js:378:4
render https://go7c.net/c90/wp-content/plugins/o2-master/js/views/comment.js?ver=5.3.2:378
addOneCommentView https://go7c.net/c90/wp-content/plugins/o2-master/js/views/post.js?ver=5.3.2:759
Underscore 2
y
forEach
$/</i.prototype[e]</< Backbone
renderComments https://go7c.net/c90/wp-content/plugins/o2-master/js/views/post.js?ver=5.3.2:564
render https://go7c.net/c90/wp-content/plugins/o2-master/js/views/post.js?ver=5.3.2:548
addOne https://go7c.net/c90/wp-content/plugins/o2-master/js/views/posts.js?ver=5.3.2:153
Underscore 2
y
forEach
$/</i.prototype[e]</< Backbone
render https://go7c.net/c90/wp-content/plugins/o2-master/js/views/posts.js?ver=5.3.2:122
initialize https://go7c.net/c90/wp-content/plugins/o2-master/js/app/main.js?ver=5.3.2:136
Backbone 2
Router
i
start https://go7c.net/c90/wp-content/plugins/o2-master/js/app/main.js?ver=5.3.2:507
https://go7c.net/c90/:855
jQuery 4
i
fireWith
ready

This error also appears in the console on POST button:

TypeError: o2.App is undefinednew-post.js:112:4
onSave https://go7c.net/c90/wp-content/plugins/o2-master/js/views/new-post.js?ver=5.3.2:112
onSave self-hosted:876
jQuery 2
dispatch
handle

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

No branches or pull requests

1 participant