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. :-)

CommentFileSizeAuthor
#2 2493235_2.patch5.85 KBMile23
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Mile23’s picture

Status: Postponed » Active
Mile23’s picture

Priority: Normal » Major
Status: Active » Needs review
FileSize
5.85 KB

Moving 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. :-) Converted t() to $this->t().

  • Mile23 committed 7b60cd8 on 8.x-1.x
    Issue #2493235 by Mile23: DBTNG Example Only Lets You Add Records If You...
Mile23’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.