{"action":"created","issue":{"url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/2458","repository_url":"https://api.github.com/repos/cfpb/cfgov-refresh","labels_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/2458/labels{/name}","comments_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/2458/comments","events_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/2458/events","html_url":"https://github.com/cfpb/cfgov-refresh/pull/2458","id":182718735,"number":2458,"title":"Hotfix: Fix links in TableBlocks","user":{"login":"richaagarwal","id":354591,"avatar_url":"https://avatars.githubusercontent.com/u/354591?v=3","gravatar_id":"","url":"https://api.github.com/users/richaagarwal","html_url":"https://github.com/richaagarwal","followers_url":"https://api.github.com/users/richaagarwal/followers","following_url":"https://api.github.com/users/richaagarwal/following{/other_user}","gists_url":"https://api.github.com/users/richaagarwal/gists{/gist_id}","starred_url":"https://api.github.com/users/richaagarwal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richaagarwal/subscriptions","organizations_url":"https://api.github.com/users/richaagarwal/orgs","repos_url":"https://api.github.com/users/richaagarwal/repos","events_url":"https://api.github.com/users/richaagarwal/events{/privacy}","received_events_url":"https://api.github.com/users/richaagarwal/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2016-10-13T07:49:04Z","updated_at":"2016-10-14T13:25:02Z","closed_at":"2016-10-13T18:42:45Z","pull_request":{"url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/2458","html_url":"https://github.com/cfpb/cfgov-refresh/pull/2458","diff_url":"https://github.com/cfpb/cfgov-refresh/pull/2458.diff","patch_url":"https://github.com/cfpb/cfgov-refresh/pull/2458.patch"},"body":"### Overview\r\n\r\nTableBlocks may reference internal documents or pages. Before we moved over to TableBlocks, these were stored as a document or page ID and a look-up occurred at the time the page rendered. But with the new TableBlocks, the actual href gets stored. In addition, the migration to TableBlocks did not convert these links to store the href. This PR takes care of that.\r\n\r\nIt would convert a row previously stored as \r\n``` \r\n[u'<p><a id=\"593\" linktype=\"document\">129</a></p>', u'<p>07/11/2016</p>', u'<p>Enforcement Counsel\\u2019s Objections to Respondents\\u2019\\nProposed Exhibits and Witnesses (Filed by <i>Consumer Financial Protection\\nBureau</i>)</p>']\r\n``` \r\nto \r\n\r\n``` \r\n[u'<p><a href=\"/documents/129_Enforcement_Counsels_Objections_to_Respondents_Proposed_Exhibits_and_Witnesses.pdf\" id=\"593\" linktype=\"document\">129</a></p>', u'<p>07/11/2016</p>', u'<p>Enforcement Counsel\\u2019s Objections to Respondents\\u2019\\nProposed Exhibits and Witnesses (Filed by <i>Consumer Financial Protection\\nBureau</i>)</p>']\r\n```\r\n\r\nNote that we actually do (at some point) want to mimic the functionality we had before, with the look-up occurring at the time the page is rendered, since the document title, etc. can change. \r\n\r\n### Deploying\r\nAssignees: @cfpb/cfgov-backends \r\nI finished this later than I was expecting to, and don't feel comfortable attempting my first deploy at this hour, so if someone gets to this in the morning and approves the changes, please feel free to do the hotfix on my behalf, as content is waiting on this fix. Once it's deployed, someone just needs to run `python cfgov/manage.py runscript fix_links_in_tableblocks` in prod. Thanks in advance!\r\n\r\n### Testing\r\nYou can test this locally with a prod dump. \r\n- `./refresh-data.sh dump.sql`\r\n-  `python cfgov/manage.py migrate`\r\n- `python cfgov/manage.py runscript fix_links_in_tableblocks`\r\n\r\nThe console should tell you a few pages have been updated. e.g. \r\n```\r\nPage edited: \"Title XIV Rules: Mortgage Origination\" id=1287 revision_id=54346\r\nPage published: \"Title XIV Rules: Mortgage Origination\" id=1287 revision_id=54346\r\nPage edited: \"Title XIV Rules: Mortgage Servicing\" id=3273 revision_id=54347\r\nPage published: \"Title XIV Rules: Mortgage Servicing\" id=3273 revision_id=54347\r\nPage edited: \"Integrity Advance, LLC and James R. Carnes\" id=1424 revision_id=54348\r\nPage published: \"Integrity Advance, LLC and James R. Carnes\" id=1424 revision_id=54348\r\n```\r\nYou can compare one of them to the one in prod to see what's been fixed. e.g. [http://localhost:8000/policy-compliance/guidance/implementation-guidance/title-xiv-mortgage-rules/](http://localhost:8000/policy-compliance/guidance/implementation-guidance/title-xiv-mortgage-rules/) vs. http://www.consumerfinance.gov/policy-compliance/guidance/implementation-guidance/title-xiv-mortgage-rules/ (Click the links to the left in the table)."},"comment":{"url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/comments/253798033","html_url":"https://github.com/cfpb/cfgov-refresh/pull/2458#issuecomment-253798033","issue_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/2458","id":253798033,"user":{"login":"sebworks","id":1696212,"avatar_url":"https://avatars.githubusercontent.com/u/1696212?v=3","gravatar_id":"","url":"https://api.github.com/users/sebworks","html_url":"https://github.com/sebworks","followers_url":"https://api.github.com/users/sebworks/followers","following_url":"https://api.github.com/users/sebworks/following{/other_user}","gists_url":"https://api.github.com/users/sebworks/gists{/gist_id}","starred_url":"https://api.github.com/users/sebworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebworks/subscriptions","organizations_url":"https://api.github.com/users/sebworks/orgs","repos_url":"https://api.github.com/users/sebworks/repos","events_url":"https://api.github.com/users/sebworks/events{/privacy}","received_events_url":"https://api.github.com/users/sebworks/received_events","type":"User","site_admin":false},"created_at":"2016-10-14T13:25:02Z","updated_at":"2016-10-14T13:25:02Z","body":"> I know this PR has been merged -- should I make this comment elsewhere for further discussion?\r\n\r\nIn regards to A, I know what the problem is and will submit a hotfix. The second issue involves the migration script adding the `jump-link` class to table block links during the migration."}}
{"actor":{"display_login":"sebworks"}}