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

[ticket/13598] Allow topic lock on topic creation #3528

Merged
merged 1 commit into from Jun 24, 2015

Conversation

@rmcgirr83
Copy link
Contributor

rmcgirr83 commented Apr 9, 2015

Allow a user, if they have the permission, to lock a topic upon creation of a topic.

PHPBB3-13598

@rmcgirr83

This comment has been minimized.

Copy link
Contributor Author

rmcgirr83 commented Apr 9, 2015

@rmcgirr83

This comment has been minimized.

Copy link
Contributor Author

rmcgirr83 commented Apr 9, 2015

No idea why this is failing on Travis :roll:

@Elsensee

This comment has been minimized.

Copy link
Member

Elsensee commented Apr 9, 2015

You're changing submit_post so it requires a value for 'topic_status' in the $post_data array. The tests don't know that yet and so they don't have a value for 'topic_status' in their $post_data array. 😉

@rmcgirr83

This comment has been minimized.

Copy link
Contributor Author

rmcgirr83 commented Apr 9, 2015

Yeah, tests confuse me. No idea on how to correct this.

@Elsensee

This comment has been minimized.

Copy link
Member

Elsensee commented Apr 9, 2015

Two possible ways:

  1. change your.. change in submit_post to something like isset($data['topic_status']) ? $data['topic_status'] : ITEM_UNLOCKED - this also is kind of a "backwards compatiblity" for some extensions which are using submit_post and would now have to change it so they don't throw that SQL error you're currently seeing in travis
  2. change the tests so they have a value for topic_status in their $post_data.

I'd go for the first way because of the "backward compatiblity" thing. 😁

@rmcgirr83

This comment has been minimized.

Copy link
Contributor Author

rmcgirr83 commented Apr 9, 2015

Thanks @Elsensee

"so they don't throw that SQL error you're currently seeing in travis"

I didn't see the SQL error...just some gibberish in a red box which I assumed was the error but it really didn't say much.

Ticket updated

EDIT: Nevermind I see them now

PHPBB3-13598
@rmcgirr83 rmcgirr83 changed the title [ticket/13598] Allow lock topic on creation [ticket/13598] Allow topic lock on topic creation Apr 9, 2015
@@ -1758,7 +1764,7 @@
'S_SIGNATURE_CHECKED' => ($sig_checked) ? ' checked="checked"' : '',
'S_NOTIFY_ALLOWED' => (!$user->data['is_registered'] || ($mode == 'edit' && $user->data['user_id'] != $post_data['poster_id']) || !$config['allow_topic_notify'] || !$config['email_enable']) ? false : true,
'S_NOTIFY_CHECKED' => ($notify_checked) ? ' checked="checked"' : '',
'S_LOCK_TOPIC_ALLOWED' => (($mode == 'edit' || $mode == 'reply' || $mode == 'quote') && ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && !empty($post_data['topic_poster']) && $user->data['user_id'] == $post_data['topic_poster'] && $post_data['topic_status'] == ITEM_UNLOCKED))) ? true : false,
'S_LOCK_TOPIC_ALLOWED' => (($mode == 'edit' || $mode == 'reply' || $mode == 'quote' || $mode == 'post') && ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && !empty($post_data['topic_poster']) && $user->data['user_id'] == $post_data['topic_poster'] && $post_data['topic_status'] == ITEM_UNLOCKED))) ? true : false,

This comment has been minimized.

Copy link
@nickvergessen

nickvergessen Apr 9, 2015

Contributor

What other modes do exist? can we drop the mode part now?

This comment has been minimized.

Copy link
@rmcgirr83

rmcgirr83 Apr 9, 2015

Author Contributor

None that seem to have to do with posting/replying/etc.. Bump, delete, soft_delete, smilies, popup. Can't see why those would matter though.

This comment has been minimized.

Copy link
@nickvergessen

nickvergessen May 9, 2015

Contributor

Nevermind, seems okay

@nickvergessen nickvergessen added this to the 3.1.5 milestone Apr 9, 2015
@rmcgirr83

This comment has been minimized.

Copy link
Contributor Author

rmcgirr83 commented Apr 10, 2015

@nickvergessen do we have a consensus that those modes can now be removed?

@marc1706

This comment has been minimized.

Copy link
Member

marc1706 commented May 28, 2015

I guess the PR is fine the way it looks right now.

@Nicofuma

This comment has been minimized.

Copy link
Member

Nicofuma commented Jun 8, 2015

👍

@rmcgirr83

This comment has been minimized.

Copy link
Contributor Author

rmcgirr83 commented Jun 8, 2015

☝️

@nickvergessen nickvergessen modified the milestones: 3.1.5, 3.1.6 Jun 11, 2015
marc1706 added a commit to marc1706/phpbb that referenced this pull request Jun 24, 2015
[ticket/13598] Allow topic lock on topic creation
@marc1706 marc1706 merged commit 77c2b2a into phpbb:3.1.x Jun 24, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@rmcgirr83 rmcgirr83 deleted the rmcgirr83:ticket/13598 branch Jun 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.