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

Domain expiration dates #888

Merged
merged 2 commits into from
Feb 23, 2024
Merged

Conversation

wrongecho
Copy link
Collaborator

  • Update logic in post when adding/editing a domain to better account for null values
  • Update logic in cron domain refresher to account for null values
  • Prevent cron domain refresher getting stuck on a single domain
  • Exclude domains with no expiration date from the cron nightly renewal alerts

- Update logic in post when adding/editing a domain to better account for null values
- Update logic in cron domain refresher to account for null values
- Prevent cron domain refresher getting stuck on a single domain
- Exclude domains with no expiration date from the cron nightly renewal alerts
@wrongecho
Copy link
Collaborator Author

Test these changes at: https://dnsexpirynullfix888.pr-review.itflow.org
(automatic message)

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
26.9% Duplication on New Code

See analysis details on SonarCloud

@NickyM
Copy link
Contributor

NickyM commented Feb 23, 2024

Pardon me for not having too much insight into either PHP or ITFlow, but shouldnt there be an ALTER TABLE statement somewhere? And changes to database initializaiton?

@wrongecho
Copy link
Collaborator Author

@NickyM I thought the same, but it turns out we actually already allow NULL for the domain expiry field!

itflow/db.sql

Line 504 in 31184f0

`domain_expire` date DEFAULT NULL,

I think the issue was the code previously was trying to add it as a variable which was then enclosed in quotes in the SQL statement, so it was treated as a string rather than an actual null.

@NickyM
Copy link
Contributor

NickyM commented Feb 23, 2024

Just realised that the error message that I got yesterday, surelay states 'NULL' and not NULL for the error. :)

[Thu Feb 22 08:47:47.736482 2024] [php:error] [pid 2047] [client 172.29.0.1:48080] PHP Fatal error: Uncaught mysqli_sql_exception: Incorrect date value: 'NULL' for column itflow.domains.domain_expire at row 1 in /var/www/html/post/domain.php:40\nStack trace:\n#0 /var/www/html/post/domain.php(40): mysqli_query()\n#1 /var/www/html/post.php(38): require_once('...')\n#2 {main}\n thrown in /var/www/html/post/domain.php on line 40, referer: [removed]

The domain adding/editing works fine for me then.

@johnnyq
Copy link
Collaborator

johnnyq commented Feb 23, 2024

@wrongecho @NickyM Things are working fine for me too. I feel confident to reel in.

@johnnyq johnnyq merged commit 603d677 into itflow-org:master Feb 23, 2024
2 checks passed
@wrongecho
Copy link
Collaborator Author

@NickyM

Just realised that the error message that I got yesterday, surelay states 'NULL' and not NULL for the error. :)

It's truly amazing how tiny, insignificant errors can make or break big features haha! Thanks again for your help on this - has been a thorn in my side since it was first added! :)

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

Successfully merging this pull request may close these issues.

3 participants