This moves room pictures out of the dialog and into it's own PictureController. Also adds a standard image (and removes the "last person to chat" picture (though we could add that back. My plan is though that direct messages use auto use the other person's photo, after we have editengine and room pictures will have a plain, replaceable image.
Details
- Reviewers
epriestley - Maniphest Tasks
- T11730: Remove image crop from Conpherence
- Commits
- rPd68c444ffada: Convert Conpherence to use normal picture setting flows
Set a new room picture, remove a picture. Run migration, see old images properly set with new image.
Diff Detail
- Repository
- rP Phabricator
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
resources/sql/autopatches/20161005.conpherence.image.2.php | ||
---|---|---|
2 | @epriestley don't think I've written a PHP migration before, can you spot check this before I fire it up on my test install. :D |
resources/sql/autopatches/20161005.conpherence.image.2.php | ||
---|---|---|
11 | This kind of thing is messy since if we put this in the migration, we can't delete the getImages() code (the migration will stop running as soon as we do, since the method won't exist anymore). Instead, you should probably do this:
You can look at 20161004.cal.01.noepoch.php for a (more complicated) example of this. I had to do the same thing there because I plan to delete most of the columns/methods it references in a future chnage. |
resources/sql/autopatches/20161005.conpherence.image.2.php | ||
---|---|---|
11 | yeah, that was my intention, do this all at the DB level so I would be able to delete all the old code. |
I still have one final bug, if I try to reset to the default image twice, I get this fatal:
>>> UNRECOVERABLE FATAL ERROR <<< Call to a member function getPHID() on boolean /var/www/html/dev/core/lib/phabricator/src/applications/conpherence/editor/ConpherenceEditor.php:340 ┻━┻ ︵ ¯\_(ツ)_/¯ ︵ ┻━┻
src/applications/conpherence/editor/ConpherenceEditor.php | ||
---|---|---|
343 | It's possible that there are no transactions left by the time we get here,, so end($xactions) might return false because $xactions is an empty array(). We can have no transactions if they were all removed because none of them did anything (e.g., set the title to the same thing, set the subtitle to the same thing, etc). We just drop transactions that don't have any effect. In this case, resetting an already-reset image is probably just being dropped. I think we can just do something like this at the top? if (!$xactions) { return $xactions; } |
Some minor nits inline, but this all looks correct to me. Nice job!
src/applications/conpherence/controller/ConpherenceController.php | ||
---|---|---|
71 | Maybe stick the '/' inside the call, so you're passing the whole URI suffix to the call. | |
src/applications/conpherence/controller/ConpherenceRoomPictureController.php | ||
25 | (Is there a ->getURI() method? Is the canonical URI /Z123?) | |
111–113 | You could use executeOne() to simplify this slightly. | |
src/applications/conpherence/editor/ConpherenceEditor.php | ||
592–593 | We should ideally still validate this, since it will be user-accessible again once we add API support. I think thee correct validation is:
We could hold this until ModularTransactions / EditEngine, though. It's fine as-is today until we add API support (and not really dangerous if we forget about it, just the first step in a chain that could eventually cause a policy violation). | |
src/applications/conpherence/storage/ConpherenceThread.php | ||
12–13 | Maybe // TODO this for removal so we don't forget about it forever? |