1 | Delivered-To: garrett@eclipse3sixty.com |
---|
2 | Received: by 2002:a6b:b603:0:0:0:0:0 with SMTP id g3-v6csp444857iof; |
---|
3 | Tue, 7 Aug 2018 23:00:42 -0700 (PDT) |
---|
4 | X-Google-Smtp-Source: AA+uWPxax5hssIZCpNTijbi+jTsGdVkLYqtqIJLSmMmugyI2ZKOvWI1DamHEnDp8abOmrVdX9Ip1 |
---|
5 | X-Received: by 2002:a24:5242:: with SMTP id d63-v6mr1133745itb.138.1533708042758; |
---|
6 | Tue, 07 Aug 2018 23:00:42 -0700 (PDT) |
---|
7 | ARC-Seal: i=1; a=rsa-sha256; t=1533708042; cv=none; |
---|
8 | d=google.com; s=arc-20160816; |
---|
9 | b=DwYKd9JPWBVkAtq+BeibGRYxU264t5OtioR+dfS3YgKIHW42aNHM8huQHz304Q47ni |
---|
10 | 8yp5S6QfXsf5LPSoSQ5mLEELoNcU+Lueu9+ubwz2suOV0rLIaftd4xIrMOd6iGyCES+2 |
---|
11 | qd1/a0oDkxELzpA6QhTR0pF7QdIid/t+H++tg7oJ4Q6pyLQGwz/0QIvDzidwDHaonZb+ |
---|
12 | r8uqMAdaigagLAwWx3yr8FBRBYo3nFc7cdDOpGaAXTyJdBLFOPi0LcRoc0Uc4aY3uHI1 |
---|
13 | 07t9CL/eYV9HHFlvC0E7ydUn3b2KJKvUMPWgqLABtom/p8ep72QANWW7TNFa14rBlXfq |
---|
14 | nQ6Q== |
---|
15 | ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; |
---|
16 | h=subject:message-id:reply-to:date:in-reply-to:references:to |
---|
17 | :auto-submitted:cc:precedence:from:mime-version:domainkey-signature |
---|
18 | :dkim-signature:arc-authentication-results; |
---|
19 | bh=Lt9mQRb8hJztmQwsHscgQugHeAWEMjXRHW8naW3AChM=; |
---|
20 | b=abOPOodygUP56U20hxpgQYWpugat2z5e6rvrMpEnjQ/yEYCS3TU96zdcTk3NLnxFrn |
---|
21 | KWd5wuNQ+fJqWvQgDAOETjlIfRhPffyRt6qVLZqGJVfnNbIUNKt9XTR8V3RSIFK2QQql |
---|
22 | f3evwsAnMVRmF+O6FDVbxm0wwrBFxfIBPTA5vVD0FfNcAr7sUv1n3+clvsksR5y6N/sJ |
---|
23 | WPHU6wb7/E5dGM5xU9obF1Wu8JKGROCmoAt7LsK6p7jP6zX1mPxO0KilbjUaMDpfwj9/ |
---|
24 | H3rL4RahIIGA0LglvmzmIoJnf1wbxDzT2sAB1MSJSMceH4al9t6ABLoUJOoUoDFc0cON |
---|
25 | RFhw== |
---|
26 | ARC-Authentication-Results: i=1; mx.google.com; |
---|
27 | dkim=pass header.i=@wordpress.org header.s=wp1 header.b="W8e/NYsh"; |
---|
28 | spf=pass (google.com: domain of noreply@wordpress.org designates 198.143.164.146 as permitted sender) smtp.mailfrom=noreply@wordpress.org; |
---|
29 | dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wordpress.org |
---|
30 | Return-Path: <noreply@wordpress.org> |
---|
31 | Received: from mail.wordpress.org (smtp1.ord.wordpress.org. [198.143.164.146]) |
---|
32 | by mx.google.com with ESMTPS id g9-v6si2276333ioa.15.2018.08.07.23.00.42 |
---|
33 | for <garrett@eclipse3sixty.com> |
---|
34 | (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); |
---|
35 | Tue, 07 Aug 2018 23:00:42 -0700 (PDT) |
---|
36 | Received-SPF: pass (google.com: domain of noreply@wordpress.org designates 198.143.164.146 as permitted sender) client-ip=198.143.164.146; |
---|
37 | Authentication-Results: mx.google.com; |
---|
38 | dkim=pass header.i=@wordpress.org header.s=wp1 header.b="W8e/NYsh"; |
---|
39 | spf=pass (google.com: domain of noreply@wordpress.org designates 198.143.164.146 as permitted sender) smtp.mailfrom=noreply@wordpress.org; |
---|
40 | dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wordpress.org |
---|
41 | Received: from mail.wordpress.org (localhost.localdomain [127.0.0.1]) |
---|
42 | by mail.wordpress.org (Postfix) with ESMTP id 2323421A70; |
---|
43 | Wed, 8 Aug 2018 06:00:42 +0000 (UTC) |
---|
44 | DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=wordpress.org; h= |
---|
45 | content-type:mime-version:from:cc:to:references:in-reply-to:date |
---|
46 | :reply-to:message-id:subject; s=wp1; bh=+Mkc3YpgGZD8PI4EACseNN4p |
---|
47 | lsI=; b=W8e/NYshn6xe7y3GJOXoK0lke7pnTcr00cEby4BJsspANTfETAxUizrY |
---|
48 | GcCblU+kvgtNMT/C5P+JwfcztITQQHpCTPSXkN1LTfVtai0W1V3Bfmd5cdCD7NEJ |
---|
49 | rO410bQ8p1v6qtqoO3Mg4XzXxCfXfUYDSNFeZk3BCq7Xmxb7aJQ= |
---|
50 | DomainKey-Signature: a=rsa-sha1; c=nofws; d=wordpress.org; h= |
---|
51 | content-type:mime-version:from:cc:to:references:in-reply-to:date |
---|
52 | :reply-to:message-id:subject; q=dns; s=wp1; b=p8IDCJKVyB0zQOMI+i |
---|
53 | lnyYWgQjA9zqcnKytSRX8EoS+hudU+I506xFggSFakU5nqpHz36uo69DZL1NKCme |
---|
54 | XIH51XPqAvUd6lbA2i19CNlkHCmrV/gP+4RPPkCajuG81g1ysO8U+wkADXSb2Vgg |
---|
55 | fBr62Hv07li7cl0ZNtryRfSKc= |
---|
56 | Content-Type: multipart/related; |
---|
57 | boundary="===============8026228139510718423==" |
---|
58 | MIME-Version: 1.0 |
---|
59 | X-Trac-Realm: ticket |
---|
60 | From: "WordPress Trac" <noreply@wordpress.org> |
---|
61 | X-Trac-Version: 1.2.2 |
---|
62 | Precedence: bulk |
---|
63 | Cc: wp-trac@lists.wordpress.org |
---|
64 | Auto-Submitted: auto-generated |
---|
65 | X-Mailer: Trac 1.2.2, by Edgewall Software |
---|
66 | To: undisclosed-recipients: ; |
---|
67 | References: <059.c6aa66ec67584456db0ae2a55c81136d@wordpress.org> |
---|
68 | X-Trac-Project: WordPress Trac |
---|
69 | In-Reply-To: <059.c6aa66ec67584456db0ae2a55c81136d@wordpress.org> |
---|
70 | Date: Wed, 08 Aug 2018 06:00:42 -0000 |
---|
71 | Reply-To: wp-hackers@lists.automattic.com |
---|
72 | Message-ID: <074.03bb288cf1c7bc0cc3ca25249061ca15@wordpress.org> |
---|
73 | X-URL: https://core.trac.wordpress.org/ |
---|
74 | X-Trac-Ticket-ID: 44707 |
---|
75 | X-Trac-Ticket-URL: https://core.trac.wordpress.org/ticket/44707#comment:4 |
---|
76 | Subject: Re: [WordPress Trac] #44707: The user should be able to create |
---|
77 | additional requests when previous duplicates are complete or |
---|
78 | archived |
---|
79 | |
---|
80 | --===============8026228139510718423== |
---|
81 | MIME-Version: 1.0 |
---|
82 | Content-Type: text/plain; charset="utf-8" |
---|
83 | Content-Transfer-Encoding: 7bit |
---|
84 | |
---|
85 | #44707: The user should be able to create additional requests when previous |
---|
86 | duplicates are complete or archived |
---|
87 | --------------------------------------------+------------------------------ |
---|
88 | Reporter: garrett-eclipse | Owner: (none) |
---|
89 | Type: defect (bug) | Status: new |
---|
90 | Priority: normal | Milestone: Awaiting Review |
---|
91 | Component: Privacy | Version: 4.9.6 |
---|
92 | Severity: normal | Resolution: |
---|
93 | Keywords: needs-refresh needs-unit-tests | Focuses: privacy |
---|
94 | --------------------------------------------+------------------------------ |
---|
95 | Changes (by garrett-eclipse): |
---|
96 | |
---|
97 | * keywords: needs-refresh reporter-feedback needs-unit-tests => needs- |
---|
98 | refresh needs-unit-tests |
---|
99 | |
---|
100 | |
---|
101 | Comment: |
---|
102 | |
---|
103 | Thanks @cc0a, |
---|
104 | |
---|
105 | Sorry looks like I got the user request stati incorrect, they should use |
---|
106 | dashes instead of underscores as seen in their register_post_status calls; |
---|
107 | https://github.com/WordPress/WordPress/blob/aab929b8d619bde14495a97cdc1eb7bdf1f1d487 |
---|
108 | /wp-includes/post.php#L318-L352 |
---|
109 | |
---|
110 | My bad, updated snippet; |
---|
111 | {{{#!php |
---|
112 | <?php |
---|
113 | // Check for duplicates. |
---|
114 | $requests_query = new WP_Query( array( |
---|
115 | 'post_type' => 'user_request', |
---|
116 | 'post_name__in' => array( $action_name ), // Action name stored |
---|
117 | in post_name column. |
---|
118 | 'title' => $email_address, // Email address stored in |
---|
119 | post_title column. |
---|
120 | 'post_status' => array( 'request-pending', 'request-confirmed' |
---|
121 | ), |
---|
122 | 'fields' => 'ids', |
---|
123 | ) ); |
---|
124 | }}} |
---|
125 | |
---|
126 | With that change this is good for some unit tests. I haven't written much |
---|
127 | unit tests so will defer to @desrosj for help but here's the guide; |
---|
128 | https://make.wordpress.org/core/handbook/testing/automated-testing |
---|
129 | /writing-phpunit-tests/ |
---|
130 | |
---|
131 | The tests should attempt to duplicate identical requests of the different |
---|
132 | stati and confirm that request-failed and request-confirmed are allowed |
---|
133 | duplicate requests while request-pending and request-confirmed block |
---|
134 | duplicates. |
---|
135 | |
---|
136 | Thanks again |
---|
137 | |
---|
138 | -- |
---|
139 | Ticket URL: <https://core.trac.wordpress.org/ticket/44707#comment:4> |
---|
140 | WordPress Trac <https://core.trac.wordpress.org/> |
---|
141 | WordPress publishing platform |
---|
142 | |
---|
143 | --===============8026228139510718423==-- |
---|