Skip to content
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.

Title field not being saved with submissions #473

Closed
2 tasks done
pwalsh opened this issue Oct 30, 2014 · 12 comments
Closed
2 tasks done

Title field not being saved with submissions #473

pwalsh opened this issue Oct 30, 2014 · 12 comments
Assignees
Milestone

Comments

@pwalsh
Copy link
Member

pwalsh commented Oct 30, 2014

The new title field is not being saved with submissions.

  • Check and fix code
  • Write test to prove it
@pwalsh pwalsh modified the milestones: Current, 10/10/2014 Oct 30, 2014
@pwalsh pwalsh self-assigned this Oct 30, 2014
@pwalsh
Copy link
Member Author

pwalsh commented Oct 31, 2014

Verified that it is not saved with initial submissions, but is saved when a submission is accepted and added to the Entry table.

@clkao
Copy link
Contributor

clkao commented Nov 1, 2014

I can reproduce this too.

@pwalsh
Copy link
Member Author

pwalsh commented Nov 2, 2014

This is a problem in one of our dependencies.

This line:

https://github.com/theoephraim/node-google-spreadsheet/blob/master/index.js#L102

Ensures that the 'title' key is stripped out of the data before it is sent to the spreadsheet, in the case of adding a new row.

I'm opening up an issue upstream for that, but for us, I'm not decided on the best course of action as yet.

@rgrp seeing as 'title' is relatively new - do you have any idea of how many instances are actually using it?

@pwalsh
Copy link
Member Author

pwalsh commented Nov 2, 2014

I made a pull request upstream:

theoephraim/node-google-spreadsheet#17

@pwalsh
Copy link
Member Author

pwalsh commented Nov 4, 2014

The issue upstream is not fixed by my pull request. Or rather, the upstream library needs deeper changes and subsequently more test coverage in order to allow column headers named 'id', 'title' or 'content'.

@loleg
Copy link

loleg commented Nov 13, 2014

Bump. Still a rather annoying data loss problem.

@rufuspollock
Copy link
Member

@loleg understood - unfortunately no fix upstream as yet - and so any immediate fix requires a DB migration ... - we are working on it :-)

@loleg
Copy link

loleg commented Nov 13, 2014

If the fix will take a while and people are still using the site - how about disabling the field with a short note for the time being?

@rufuspollock
Copy link
Member

@loleg we were hoping it would be fixed monday, then tuesday etc. We have pushed patch upstream but some issues. You are correct that we should perhaps just disable - but we would also like to fix. Will get to this in next 12h.

@loleg
Copy link

loleg commented Nov 13, 2014

@rgrp great. I have the code running locally and have reproduced the bug, let me know if I can do any testing or so.

@pwalsh
Copy link
Member Author

pwalsh commented Nov 13, 2014

I'm looking at this now

@pwalsh
Copy link
Member Author

pwalsh commented Nov 13, 2014

Fixed in a18883a

The commit actually just has tests - all changes are in configuration of questions, submissions and entries backends.

See the commit message, also copied here:

Fixes issue with "title" by renaming to "officialtitle". Problem due to bug in dependency. Has testsm and test database has been updated with the "officialtitle" field (it did not have the "title" field either).

Steps required:

  • Rename your "title" question identifier to "officialtitle"
  • If "title" is a dependant field in your configuration, also rename the reference in the dependants field of the parent
  • rename "title" to "officialtitle" in your submissions database
  • rename "title" to "officialtitle" in your entries database
  • Do /admin/reload/ with appropriate permissions

Important

In order to minimise the effect of this change, I created a new questions spreadsheet for use on the global census. This sheet has the updated "title" > "officialtitle" question. The default question spreadsheet does not. This seemed like the safest action at present. I'm creating a new issue for dealing with the generic question sheet & city census instances.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants