Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#23066 closed defect (bug) (invalid)

WordPress 3.5 Duplicate Entry

Reported by: chriscct7's profile chriscct7 Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.5
Component: Unit Tests Keywords: has-patch
Focuses: Cc:

Description

WordPress 3.5 MU when running PHP 5.2.17/5.3.x/5.4.x seems to have some duplicate install code.
Detected by Travis-CI.

Example build where error is present:
https://travis-ci.org/chriscct7/Easy-Digital-Downloads/jobs/3855494
3/4 of the way down you'll find the following:

Installing network…
Installing sites…
WordPress database error Duplicate entry '1' for key 'PRIMARY' for query INSERT INTO `wp_terms` (`term_id`,`name`,`slug`,`term_group`) VALUES (1,'Uncategorized','uncategorized',0) made by wp_install, wp_install_defaults
WordPress database error Duplicate entry '1-category' for key 'term_id_taxonomy' for query INSERT INTO `wp_term_taxonomy` (`term_id`,`taxonomy`,`description`,`parent`,`count`) VALUES (1,'category','',0,1) made by wp_install, wp_install_defaults

Attachments (9)

3400b823567ecd4cdefdf59866bb245a8fc3121b.patch.txt (3.0 KB) - added by chriscct7 11 years ago.
First .patch
3400b823567ecd4cdefdf59866bb245a8fc3121b.diff.2.txt (2.7 KB) - added by chriscct7 11 years ago.
First .diff
patch2.diff.txt (652 bytes) - added by sunnyratilal 11 years ago.
Add a check if multisite was called or not
second_try.patch (3.7 KB) - added by chriscct7 11 years ago.
Second Try
second_try.diff (2.8 KB) - added by chriscct7 11 years ago.
Second Try Diff
third_try.diff (349 bytes) - added by chriscct7 11 years ago.
Third Try Diff
third_try.patch (1.3 KB) - added by chriscct7 11 years ago.
Third Try Patch
fourth_try.diff (2.8 KB) - added by chriscct7 11 years ago.
Fourth Try Diff
fourth_try.patch (4.4 KB) - added by chriscct7 11 years ago.
Fourth Try Patch

Download all attachments as: .zip

Change History (28)

#1 @chriscct7
11 years ago

  • Cc chriscct7@… added

#2 @mordauk
11 years ago

  • Cc pippin@… added

#3 @nacin
11 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

The problem here seems to be that a multisite switch is not occurring before the test suite installs additional sites. But, for this and other reasons, the test suite no longer installs any sites beyond the first one.

#4 @mordauk
11 years ago

I've seen this happen as well after upgrading to 3.5, though I don't recall if the error was exactly the same.

#5 @sunnyratilal
11 years ago

  • Cc ratilal.sunny@… added
  • Resolution invalid deleted
  • Status changed from closed to reopened

I've fixed this bug: on MS install, the Unit Tests were calling the install script twice. I've amended the script and you can find it my repo: https://github.com/sunnyratilal/WordPress-Tests

#6 @sunnyratilal
11 years ago

  • Keywords dev-feedback added

#7 @chriscct7
11 years ago

  • Component changed from Upgrade/Install to Unit Tests
  • Keywords has-patch added

#8 follow-up: @chriscct7
11 years ago

@nacin Still working on figuring out how to get the .patch and .diff files, but in the meantime, the commit is: https://github.com/sunnyratilal/WordPress-Tests/commit/3400b823567ecd4cdefdf59866bb245a8fc3121b

#9 @SergeyBiryukov
11 years ago

  • Milestone set to Awaiting Review

#10 follow-up: @chriscct7
11 years ago

Okay they are up. FYI not sure if a Trac limitation but raw .diff/.patch files are locking up the Trac server so I postfixed the files with .txt

#11 @markoheijnen
11 years ago

If I seeing ti wrong. Aren't you now always set it as a multisite installation?

#12 @sunnyratilal
11 years ago

Oh yeah, whoops, will get that fixed up. Thanks.

@sunnyratilal
11 years ago

Add a check if multisite was called or not

#13 in reply to: ↑ 10 ; follow-up: @SergeyBiryukov
11 years ago

Replying to chriscct7:

FYI not sure if a Trac limitation but raw .diff/.patch files are locking up the Trac server so I postfixed the files with .txt

Generally, patches should be uploaded with .diff or .patch extension for proper highlighting.

See also http://scribu.net/wordpress/svn-patches-from-git.html.

#14 in reply to: ↑ 13 ; follow-up: @chriscct7
11 years ago

Replying to SergeyBiryukov:

Yeah I did try that, but Trac literally locked the Database for 30 seconds every time I did that.

Replying to chriscct7:

FYI not sure if a Trac limitation but raw .diff/.patch files are locking up the Trac server so I postfixed the files with .txt

Generally, patches should be uploaded with .diff or .patch extension for proper highlighting.

See also http://scribu.net/wordpress/svn-patches-from-git.html.

@chriscct7
11 years ago

Second Try

@chriscct7
11 years ago

Second Try Diff

@chriscct7
11 years ago

Third Try Diff

@chriscct7
11 years ago

Third Try Patch

@chriscct7
11 years ago

Fourth Try Diff

@chriscct7
11 years ago

Fourth Try Patch

#15 @chriscct7
11 years ago

Ok someone should check me on this. Merged the diff from 3 commits by using a starter and ender tag. Made patch/diff by using git bash:

Diff:

$ git diff Starter Ender -- > fourth_try.diff

Patch:

$ git checkout Ender

$ git format-patch Starter --stdout > fourth_try.patch

Starter is commit:
https://github.com/chriscct7/WordPress-Tests/commit/3400b823567ecd4cdefdf59866bb245a8fc3121b

Ender is commit:
https://github.com/chriscct7/WordPress-Tests/commit/f4e566e388e0b218dc1abf1cdd1de48370816967

#16 in reply to: ↑ 14 @SergeyBiryukov
11 years ago

Replying to chriscct7:

Yeah I did try that, but Trac literally locked the Database for 30 seconds every time I did that.

Probably unrelated. I just got "OperationalError: database is locked" when submitting a comment.

fourth_try.diff looks proper, however still doesn't apply. Your copy of the repo appears to be out of date. bin/install.php was moved to includes/install.php in [1100/tests], and there are other changes in the file as well.

#17 in reply to: ↑ 8 @rmccue
11 years ago

Replying to chriscct7:

@nacin Still working on figuring out how to get the .patch and .diff files, but in the meantime, the commit is: https://github.com/sunnyratilal/WordPress-Tests/commit/3400b823567ecd4cdefdf59866bb245a8fc3121b

Just FYI, you can append .diff to the URL to get a diff for it. The only thing that then needs to be changed is to remove a/ and b/ from each path.

#18 @sunnyratilal
11 years ago

  • Resolution set to invalid
  • Status changed from reopened to closed

#19 @SergeyBiryukov
11 years ago

  • Keywords dev-feedback removed
  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.