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

fix(attachments): allow null expireDate in createShare #12432

Closed
wants to merge 1 commit into from

Conversation

ShGKme
Copy link
Contributor

@ShGKme ShGKme commented May 28, 2024

☑️ Resolves

🛠️ API Checklist

🚧 Tasks

  • Make expireDate nullable and check for null on setting date

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not possible
  • 📘 API documentation in docs/ has been updated or is not required
  • 🔖 Capability is added or not needed

Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
@ShGKme ShGKme added this to the 💙 Next Major (30) milestone May 28, 2024
@ShGKme ShGKme self-assigned this May 28, 2024
@ShGKme
Copy link
Contributor Author

ShGKme commented May 28, 2024

/backport to stable29

@ShGKme
Copy link
Contributor Author

ShGKme commented May 28, 2024

/backport to stable28

@ShGKme
Copy link
Contributor Author

ShGKme commented May 28, 2024

/backport to stable27

@SystemKeeper
Copy link
Contributor

  • Or is it better to fix on server side?

If I understand the changes correctly, the public interface always allowed it to be null?

https://github.com/nextcloud/server/pull/44485/files#diff-10411333a1207c164cd88b80b0df9d1987227d1bfb4ae215454b34fc28eb48aa

Which I would then say needs to be fixed in talk?

Copy link
Contributor

@nfebe nfebe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok so far.

$share->setSharedWith($shareWith);
$share->setPermissions($permissions);

if ($expireDate !== '') {
if ($expireDate !== null && $expireDate !== '') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty returns true for both null and empty string ('').

Suggested change
if ($expireDate !== null && $expireDate !== '') {
if (!empty($expireDate)) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but I wanted to keep it separated to explicitly show 2 different cases, because '' and null have different semantics here

@AndyScherzinger AndyScherzinger requested a review from artonge May 28, 2024 20:51
@ShGKme ShGKme requested a review from danxuliu May 29, 2024 09:38
@ShGKme
Copy link
Contributor Author

ShGKme commented May 29, 2024

@ShGKme ShGKme closed this May 29, 2024
@Antreesy Antreesy deleted the fix/attachments-with-no-expire-date branch May 31, 2024 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants