Comments

joachim’s picture

Probably good thing too, because I see it's broken -- it's calling entityQuery on the flag_counts table, which isn't an entity table!

martin107’s picture

Status: Active » Needs review
StatusFileSize
new3.49 KB

Not all tests pass - It is not the complete solution, but I think it get us most of the way there.

PS I spawned off another issue to fix a foible.
#2482123: FlagSimpletest - do not continue the process.

Status: Needs review » Needs work

The last submitted patch, 2: counts-2472695-2.patch, failed testing.

martin107’s picture

Status: Needs work » Needs review
StatusFileSize
new3.53 KB

reroll.

Status: Needs review » Needs work

The last submitted patch, 4: counts-2472695-4.patch, failed testing.

Status: Needs work » Needs review

martin107 queued 4: counts-2472695-4.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, 4: counts-2472695-4.patch, failed testing.

joshi.rohit100’s picture

I think, user deletion is currently not associated with flag. Thats why when delete is called nothing happens on flag table.

socketwench’s picture

Status: Needs work » Postponed

I think, user deletion is currently not associated with flag. Thats why when delete is called nothing happens on flag table.

Looks like that's the problem. New issue: #2487766: flag_user_cancel(), flag_user_delete() circumvent APIs

socketwench’s picture

That was a duplicate, which I was too sleep deprived last night to notice.

This issue is blocked by: https://www.drupal.org/node/2477989

joachim’s picture

Status: Postponed » Active
martin107’s picture

Status: Active » Needs review
StatusFileSize
new3.53 KB

Sorry I almost forgot about this issue.

Before I work on this.... reroll.

Status: Needs review » Needs work

The last submitted patch, 12: counts-2472695-12.patch, failed testing.

martin107’s picture

Title: test method doTestFlagCounts() is not executed » Test method doTestFlagCounts() is not executed.
Status: Needs work » Needs review
StatusFileSize
new4.1 KB
new583 bytes

Yay testing uncovered a bug .... in FlagCountManager::decrementCount()

The purpose of the $this->connection->select('flag_counts') command
is to extract a 'count' value from a row in a database...

The buggy code was counting the number of returned rows, and not actually inspecting the value of the count field.

The value returned is a string hence the change to a '1'

Locally FlagSimpleTest now passes.

joachim’s picture

Status: Needs review » Fixed

Nice!

  • joachim committed 5a8a61c on 8.x-4.x authored by martin107
    Issue #2472695 by martin107: Fixed incorrect query result in...

Status: Fixed » Closed (fixed)

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