Opened 3 years ago

Closed 3 months ago

Last modified 3 months ago

#128 closed defect (fixed)

Path isn't set when adding project

Reported by: rmccue Owned by: markoheijnen
Priority: major Milestone: 1.0
Component: general Version: 0.1
Keywords: Cc: juanramondiaz, stas@…

Description

The "path" field is not set by GlotPress when attempting to add a project to the database. As the field in the schema is marked NOT NULL, this causes the project to not be created. Additionally, no error is displayed when this occurs.

Attachments (2)

128.diff (379 bytes) - added by markoheijnen 3 months ago.
Validate slug
128.2.diff (1010 bytes) - added by markoheijnen 3 months ago.
Includes 1 unit tests

Download all attachments as: .zip

Change History (15)

  • Cc juanramondiaz added
  • Resolution set to worksforme
  • Status changed from new to closed

For me, it's working fine. This ticket was opened 16 months ago, so maybe it's an old bug.

  • Resolution worksforme deleted
  • Status changed from closed to reopened

I can reproduce this one on my live site but not on my testbed. Not sure what server side is causing this to happen. It would probably be better to set everything in the insert query for the project rather than insert a partial project and update with the path shortly afterward.

If you need any additional information about my two environments I'll try to provide it.

  • Keywords reporter-feedback added
  • Owner changed from somebody to petervanderdoes
  • Status changed from reopened to accepted

Let's revive this one :)

First is this still an issue? If yes continue if not, glad I could help LOL.

Please update to the latest revision of GlotPress.

If it's still an issue:

  1. What's the name of your project?
  2. Do you set the slug or let GlotPress handle it?
  3. Is it a child project? If so the questions 1 and 2 apply to the parent as well.

Environment:
For both production and test bed.
PHP version

I just hope it's no longer a problem :)

  • Cc stas@… added
  • Keywords dev-feedback needs-testing added
  • Milestone set to 1.0
  • Version set to 0.1

I tested this locally.

project name test, slug left blank, path is correctly set to test.
sub-project name test, slug left blank, path is correctly set to test/test.
project name @@@, slug left blank, path is set to blank. Project is created but impossible to navigate to.

Looks like there is an issue when the name contains only characters that can't be slugified.

I have the same problem running NGINX 1.2.7, PHP 5.4.

It did not matter what I used as a slug. It resulted in the path not being set.

Temporary solution for me was to allow NULL for path in the DB. Because the path is set in another query it wasn't a problem.

  • Owner changed from petervanderdoes to markoheijnen
  • Status changed from accepted to assigned

I see issues with what willmot described. However not what tschutter described when running nginx 1.2.5/1.2.7 and PHP 5.4.4. I will be working on a fix. Something in the way of checking/creating the slug before inserting the project. When empty return an error.

Validate slug

comment:8 follow-up: ↓ 9   markoheijnen3 months ago

I added a patch. This seems good enough. Curious what you guys think about it.

Last edited 3 months ago by markoheijnen (previous) (diff)

comment:9 in reply to: ↑ 8   markoheijnen3 months ago

Last edited 3 months ago by markoheijnen (previous) (diff)

Includes 1 unit tests

  • Keywords has-patch added; reporter-feedback needs-testing removed

Just added another patch testing a project with @@@@ as name.

  • Keywords commit added
  • Resolution set to fixed
  • Status changed from assigned to closed

(In [744]) Don't allow slug to be empty. This can happen when the project name has only illegal characters. Fixes #128

  • Keywords dev-feedback has-patch commit removed
Note: See TracTickets for help on using tickets.