Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
While trying to fix head so it passes tests, I discovered that there has to be a logged-in user (uid !=0) in order to be able to add records on the add-records page.
So this is a follow-up issue on that round of bug-fixes.
I believe this stems from the fact that the uid column in DBTNG example is set to not allow NULL values. Which Drupal might take to mean 0. As in user id 0 for anonymous users.
Should we care whether a user has to be logged in? Should we allow anonymous users to add records?
This issue is immediately postponed on getting HEAD caught up. :-)
Comment | File | Size | Author |
---|---|---|---|
#2 | 2493235_2.patch | 5.85 KB | Mile23 |
|
Comments
Comment #1
Mile23Comment #2
Mile23Moving to major since it can result in a crash if you're anonymous, but not critical since most people won't be using this as anonymous.
Rather than restructure the way the whole system works, I've just added validation to
DbtngExampleAddForm
. If you're anonymous, you get an error back.Added a test to make sure it works, and also check the age-number error, and remove t() from test cases.
Reworked the form to avoid using
FormBase
, because we don't like it. :-) Convertedt()
to$this->t()
.Comment #4
Mile23