Collected fixes and improvements #85

Merged
laurensmartina merged 18 commits from tomerge into master 2018-10-29 16:00:36 +00:00
laurensmartina commented 2018-10-09 10:25:29 +00:00 (Migrated from github.com)
No description provided.
matthijskooijman (Migrated from github.com) reviewed 2018-10-16 09:36:48 +00:00
matthijskooijman (Migrated from github.com) left a comment

Overall, this PR looks good! I've left some inline comments, which are mostly about pieces of code which I believe would be better placed in a different or separate commit, or about commit messages. In general, commit messages could be a bit more verbose, especially because some of these commits are bigger than would be ideal.

I've not reviewed the Article and WymEditor commits in detail, since I really ought to be doing othe work today :-p

Overall, this PR looks good! I've left some inline comments, which are mostly about pieces of code which I believe would be better placed in a different or separate commit, or about commit messages. In general, commit messages could be a bit more verbose, especially because some of these commits are bigger than would be ideal. I've not reviewed the Article and WymEditor commits in detail, since I really ought to be doing othe work today :-p
@ -1,7 +1,7 @@
.idea
/system/wymeditor/
/data/pages/
matthijskooijman (Migrated from github.com) commented 2018-10-16 09:30:16 +00:00

This commit needs a better commit message too. It does not really add WYMEditor, since we were already using that. It does add the source or WYMEditor, but also makes a lot of other changes to how WYMEditor works. Stating these changes explicitly would be better. Also, please mention the version of WYMEditor that is added, for future reference (version number and/or git hash), and whether any changes were made to the upstream wymeditor code (if so, adding the code verbatim first and then modifying the code in a separate commit would be preferred).

This commit needs a better commit message too. It does not really add WYMEditor, since we were already using that. It does add the *source* or WYMEditor, but also makes a lot of other changes to how WYMEditor works. Stating these changes explicitly would be better. Also, please mention the version of WYMEditor that is added, for future reference (version number and/or git hash), and whether any changes were made to the upstream wymeditor code (if so, adding the code verbatim first and then modifying the code in a separate commit would be preferred).
matthijskooijman (Migrated from github.com) commented 2018-10-16 09:34:45 +00:00

This commit adds third-party sources. It would be good if the commit message lists the upstream locations and versions of these.

This commit adds third-party sources. It would be good if the commit message lists the upstream locations and versions of these.
@ -73,2 +63,4 @@
$hyphaQuery = $hyphaRequest->getRelativeUrlPath();
$hyphaUrl = $hyphaRequest->getRootUrl();
// Shortcut for direct file requests
matthijskooijman (Migrated from github.com) commented 2018-10-16 08:30:51 +00:00

These readdir -> scandir changs seem unrelated to the core of this commit? Not a big deal, though.

These readdir -> scandir changs seem unrelated to the core of this commit? Not a big deal, though.
@ -84,6 +80,7 @@
matthijskooijman (Migrated from github.com) commented 2018-10-16 09:13:04 +00:00

Interesting approach to autodetect datatype classes. Not sure if I really find it elegant or hacky, though :-p

In any case, this change would be better in a separate commit, or should at least be mentioned by the commit message.

Interesting approach to autodetect datatype classes. Not sure if I really find it elegant or hacky, though :-p In any case, this change would be better in a separate commit, or should at least be mentioned by the commit message.
matthijskooijman (Migrated from github.com) commented 2018-10-16 08:36:15 +00:00

These are whitespace-only changes that might have been better in a separate commit?

These are whitespace-only changes that might have been better in a separate commit?
matthijskooijman (Migrated from github.com) commented 2018-10-16 08:37:00 +00:00

Isn't $hyphaUser deprecated too?

Isn't $hyphaUser deprecated too?
@ -0,0 +88,4 @@
}
return $this->dictionary;
}
matthijskooijman (Migrated from github.com) commented 2018-10-16 08:41:16 +00:00

Should this be cached? Now, I think, every call to __ for translation reloads the entire translation file?

Should this be cached? Now, I think, every call to __ for translation reloads the entire translation file?
matthijskooijman (Migrated from github.com) commented 2018-10-16 09:31:33 +00:00

This also means that no two users with usernames only differing in case can ever exist. Does user registration use this same function to guarantee this?

This also means that no two users with usernames only differing in case can ever exist. Does user registration use this same function to guarantee this?
matthijskooijman (Migrated from github.com) commented 2018-10-16 09:05:04 +00:00

Should this have a comment saying it only modifies hypha.xml and you should usually use deletePage instead?

Should this have a comment saying it only modifies hypha.xml and you should usually use deletePage instead?
matthijskooijman (Migrated from github.com) commented 2018-10-16 09:07:29 +00:00

Should we really delete pages? Or mark them as deleted and allow an admin to view a list of deleted pages? Probably a separate discussion that should not block this merge, though.

Should we *really* delete pages? Or mark them as deleted and allow an admin to view a list of deleted pages? Probably a separate discussion that should not block this merge, though.
matthijskooijman (Migrated from github.com) commented 2018-10-16 09:17:57 +00:00

Is this "is private" check (or rather, "normalize boolean" check) something to put in a util function (which should probably return bool, not 'on'/'off'? Probably something that is fine for a new commit after merging this PR, though.

Is this "is private" check (or rather, "normalize boolean" check) something to put in a util function (which should probably return bool, not 'on'/'off'? Probably something that is fine for a new commit after merging this PR, though.
matthijskooijman (Migrated from github.com) commented 2018-10-16 09:25:32 +00:00

I'm not really sure what kind of improvements this commit really makes. Ideally, the commit message should explain any change in behaviour, just saying "improved" is vague unless it is really obvious from a very short commit (and even then, explaining is better).

I'm not really sure what kind of improvements this commit really makes. Ideally, the commit message should explain any change in behaviour, just saying "improved" is vague unless it is really obvious from a very short commit (and even then, explaining is better).
matthijskooijman (Migrated from github.com) commented 2018-10-16 09:22:09 +00:00

This $pageListDatatype variable is introduced, but not used anywhere. It also seems unrelated to private handling, making me suspect this line belongs in a later commit?

This $pageListDatatype variable is introduced, but not used anywhere. It also seems unrelated to private handling, making me suspect this line belongs in a later commit?
matthijskooijman (Migrated from github.com) commented 2018-10-16 09:23:58 +00:00

Also, adding this line is the only thing changed by this entire patch hunk I believe (other than whitespace changes), so the entire thing could then be moved.

Also, adding this line is the only thing changed by this entire patch hunk I believe (other than whitespace changes), so the entire thing could then be moved.
matthijskooijman (Migrated from github.com) commented 2018-10-16 09:33:54 +00:00

This seems unrelated to styling?

This seems unrelated to styling?
matthijskooijman (Migrated from github.com) commented 2018-10-16 09:34:16 +00:00

This seems unrelated to styling?

This seems unrelated to styling?
@ -131,3 +130,3 @@
$_name = $hyphaRequest->getPageName();
$_name = $request->getPageName();
if ($_name === null) {
$_name = hypha_getDefaultPage();
matthijskooijman (Migrated from github.com) commented 2018-10-16 09:21:19 +00:00

Doesn't this mean the user gets a 404 when they're not logged in, rather than a message saying they should login? This is better from a strict security perspective, but leakage of private page names does not seem like a big issue here and could be less important than usability?

Doesn't this mean the user gets a 404 when they're not logged in, rather than a message saying they should login? This is better from a strict security perspective, but leakage of private page names does not seem like a big issue here and could be less important than usability?
matthijskooijman (Migrated from github.com) commented 2018-10-16 08:42:57 +00:00

Is this session language stuff preserved anywhere? If it is no longer relevant and removed, the commit message might state this.

Is this session language stuff preserved anywhere? If it is no longer relevant and removed, the commit message might state this.
@ -340,3 +361,3 @@
notify('success', __('festival-successful-signup-for') . $this->getConfig('festival-title'));
$contribute_url = $hyphaUrl . $hyphaLanguage . '/' . $this->pagename . '/contribute/' . $participant->getAttribute('xml:id') . '/' . $participant->getAttribute('key');
$contribute_url = $hyphaUrl . $hyphaContentLanguage . '/' . $this->pagename . '/contribute/' . $participant->getAttribute('xml:id') . '/' . $participant->getAttribute('key');
matthijskooijman (Migrated from github.com) commented 2018-10-16 09:02:38 +00:00

In addition to introducing RequestContext, this commit also introduces the split between UI language and content language. This was originally a separate commit, I think. It is probably too much work to split these now (since then the original loadLanguage would need to be re-introduced and modified), but this split should probably be mentioned in the commit message.

In addition to introducing RequestContext, this commit also introduces the split between UI language and content language. This was originally a separate commit, I think. It is probably too much work to split these now (since then the original loadLanguage would need to be re-introduced and modified), but this split should probably be mentioned in the commit message.
@ -97,6 +97,7 @@
"changed-css" => " edited the website's CSS layout",
"changed-html" => " edited the website's HTML structure",
"changed-page" => " edited the following page: ",
"deleted-page" => " deleted the following page: ",
matthijskooijman (Migrated from github.com) commented 2018-10-16 09:03:49 +00:00

These changes add strings that are not used until the next commit, so they would make more sense in the next commit?

These changes add strings that are not used until the next commit, so they would make more sense in the next commit?
laurensmartina (Migrated from github.com) reviewed 2018-10-22 10:35:14 +00:00
@ -73,2 +63,4 @@
$hyphaQuery = $hyphaRequest->getRelativeUrlPath();
$hyphaUrl = $hyphaRequest->getRootUrl();
// Shortcut for direct file requests
laurensmartina (Migrated from github.com) commented 2018-10-22 10:35:12 +00:00

Moved to own commit

Moved to own commit
laurensmartina (Migrated from github.com) reviewed 2018-10-22 11:40:25 +00:00
laurensmartina (Migrated from github.com) commented 2018-10-22 11:40:24 +00:00

added @deprecated

added @deprecated
laurensmartina (Migrated from github.com) reviewed 2018-10-22 11:48:38 +00:00
@ -0,0 +88,4 @@
}
return $this->dictionary;
}
laurensmartina (Migrated from github.com) commented 2018-10-22 11:48:37 +00:00

Nice catch! Implemented cache

Nice catch! Implemented cache
laurensmartina (Migrated from github.com) reviewed 2018-10-22 11:57:38 +00:00
laurensmartina (Migrated from github.com) commented 2018-10-22 11:57:38 +00:00

Added extra line in commit message

Added extra line in commit message
laurensmartina (Migrated from github.com) reviewed 2018-10-22 12:13:09 +00:00
@ -97,6 +97,7 @@
"changed-css" => " edited the website's CSS layout",
"changed-html" => " edited the website's HTML structure",
"changed-page" => " edited the following page: ",
"deleted-page" => " deleted the following page: ",
laurensmartina (Migrated from github.com) commented 2018-10-22 12:13:09 +00:00

Moved to other commit

Moved to other commit
laurensmartina (Migrated from github.com) reviewed 2018-10-22 12:18:13 +00:00
laurensmartina (Migrated from github.com) commented 2018-10-22 12:18:12 +00:00

From a scope perspective I think it's a bit weird that hypha_deletePage "knows" about deletePage. I think the readme should contain a chapter containing datatypes and this information should be placed there.

From a scope perspective I think it's a bit weird that `hypha_deletePage` "knows" about `deletePage`. I think the readme should contain a chapter containing datatypes and this information should be placed there.
laurensmartina (Migrated from github.com) reviewed 2018-10-22 12:19:22 +00:00
laurensmartina (Migrated from github.com) commented 2018-10-22 12:19:21 +00:00

Good idea! This can be implemented if needed.

Good idea! This can be implemented if needed.
laurensmartina (Migrated from github.com) reviewed 2018-10-22 12:43:35 +00:00
@ -84,6 +80,7 @@
laurensmartina (Migrated from github.com) commented 2018-10-22 12:43:34 +00:00

I understand that it looks a bit hacky but I do believe this to be less error prone.

I've put it in a separate commit.

I understand that it looks a bit hacky but I do believe this to be less error prone. I've put it in a separate commit.
laurensmartina (Migrated from github.com) reviewed 2018-10-22 12:54:13 +00:00
laurensmartina (Migrated from github.com) commented 2018-10-22 12:54:12 +00:00

Moved $pageListDatatype to other commit

Moved $pageListDatatype to other commit
laurensmartina (Migrated from github.com) reviewed 2018-10-22 13:07:34 +00:00
laurensmartina (Migrated from github.com) commented 2018-10-22 13:07:34 +00:00

Agreed, a util function would be better.

I've updated the commit message to explain the change.

Agreed, a util function would be better. I've updated the commit message to explain the change.
laurensmartina (Migrated from github.com) reviewed 2018-10-22 13:37:33 +00:00
@ -131,3 +130,3 @@
$_name = $hyphaRequest->getPageName();
$_name = $request->getPageName();
if ($_name === null) {
$_name = hypha_getDefaultPage();
laurensmartina (Migrated from github.com) commented 2018-10-22 13:37:33 +00:00

When, when a not-logged-in user tries the access a private page they will see a login-to-view message.

When, when a not-logged-in user tries the access a private page they will see a login-to-view message.
laurensmartina (Migrated from github.com) reviewed 2018-10-22 13:44:23 +00:00
laurensmartina (Migrated from github.com) commented 2018-10-22 13:44:23 +00:00

Yes, no two users with usernames only differing in case can ever exist.
Yes, the user registration uses this same function to guarantee this.

Yes, no two users with usernames only differing in case can ever exist. Yes, the user registration uses this same function to guarantee this.
laurensmartina (Migrated from github.com) reviewed 2018-10-22 13:53:43 +00:00
laurensmartina (Migrated from github.com) commented 2018-10-22 13:53:42 +00:00

The $file can contain non-strict html that would cause errors, therefore those errors are ignored. In my opinion the non-strictness is only for styling purposes.

The `$file` can contain non-strict html that would cause errors, therefore those errors are ignored. In my opinion the non-strictness is only for styling purposes.
laurensmartina (Migrated from github.com) reviewed 2018-10-22 13:59:36 +00:00
laurensmartina (Migrated from github.com) commented 2018-10-22 13:59:35 +00:00

Changed commit message to "improved UX".

Changed commit message to "improved UX".
laurensmartina (Migrated from github.com) reviewed 2018-10-22 14:06:55 +00:00
laurensmartina (Migrated from github.com) commented 2018-10-22 14:06:55 +00:00

This actually ignores third-party sources.

This actually ignores third-party sources.
laurensmartina (Migrated from github.com) reviewed 2018-10-22 18:30:29 +00:00
@ -1,7 +1,7 @@
.idea
/system/wymeditor/
/data/pages/
laurensmartina (Migrated from github.com) commented 2018-10-22 18:30:28 +00:00

The commit is split as suggested, the commit message is updated.

The commit is split as suggested, the commit message is updated.
laurensmartina (Migrated from github.com) reviewed 2018-10-22 18:33:13 +00:00
laurensmartina (Migrated from github.com) commented 2018-10-22 18:33:13 +00:00

Agreed. I'll do that next time.

Agreed. I'll do that next time.
matthijskooijman (Migrated from github.com) reviewed 2018-10-23 07:33:42 +00:00
matthijskooijman (Migrated from github.com) commented 2018-10-23 07:33:42 +00:00

Did you push your changes? I can't see anything in the commit message here: https://github.com/PlanBCode/hypha/pull/85/commits/837b9eb27d98d71c2d745fdc9b09497c81e78f8e

Did you push your changes? I can't see anything in the commit message here: https://github.com/PlanBCode/hypha/pull/85/commits/837b9eb27d98d71c2d745fdc9b09497c81e78f8e
laurensmartina (Migrated from github.com) reviewed 2018-10-24 06:29:12 +00:00
laurensmartina (Migrated from github.com) commented 2018-10-24 06:29:12 +00:00

I think I reverted the commit when something when wrong and I forgot to put back the commit message. Now again I've added an extra detail in the commit message.

I think I reverted the commit when something when wrong and I forgot to put back the commit message. Now again I've added an extra detail in the commit message.
matthijskooijman (Migrated from github.com) reviewed 2018-10-25 09:37:12 +00:00
matthijskooijman (Migrated from github.com) commented 2018-10-25 09:37:12 +00:00

I created #88 for this.

I created #88 for this.
matthijskooijman (Migrated from github.com) reviewed 2018-10-25 09:46:10 +00:00
@ -131,3 +130,3 @@
$_name = $hyphaRequest->getPageName();
$_name = $request->getPageName();
if ($_name === null) {
$_name = hypha_getDefaultPage();
matthijskooijman (Migrated from github.com) commented 2018-10-25 09:46:10 +00:00

I've added a bit more to the commit message for this change:

Additionally, the check for a private page now happens in loadPage,
rather than in the page's show(). This helps to make sure that the flag
is always checked, and makes sure a 404 is returned.

I've added a bit more to the commit message for this change: > Additionally, the check for a private page now happens in loadPage, > rather than in the page's show(). This helps to make sure that the flag > is always checked, and makes sure a 404 is returned.
matthijskooijman (Migrated from github.com) reviewed 2018-10-25 09:55:15 +00:00
matthijskooijman (Migrated from github.com) commented 2018-10-25 09:55:15 +00:00

I've moved the libxml change to its own commit, and clarified in the code that this only ignores unknown tag errors, not all errors as I previously thought when quickly reading the code.

I've moved the libxml change to its own commit, and clarified in the code that this only ignores unknown tag errors, not *all* errors as I previously thought when quickly reading the code.
matthijskooijman (Migrated from github.com) reviewed 2018-10-25 10:13:12 +00:00
matthijskooijman (Migrated from github.com) commented 2018-10-25 10:13:12 +00:00

I meant the commit this change is in, not this particular change (I just took the first change in the commit, since you can't comment on a commit anymore in github). However, I see now that this is not really clear.

In any case, I meant files like normalize.css. I've now found the source for this file and put it in the commit message. I've also removed chota.css and cclogo.png, both of which seemed unused (and chota.css was in data/ rather than data/css, which seemed odd).

For the dosis font, I couldn't find a canonical source. Perhaps we should clarify the source along with the license (see #89).

I meant the commit this change is in, not this particular change (I just took the first change in the commit, since you can't comment on a commit anymore in github). However, I see now that this is not really clear. In any case, I meant files like normalize.css. I've now found the source for this file and put it in the commit message. I've also removed chota.css and cclogo.png, both of which seemed unused (and chota.css was in data/ rather than data/css, which seemed odd). For the dosis font, I couldn't find a canonical source. Perhaps we should clarify the source along with the license (see #89).
matthijskooijman (Migrated from github.com) reviewed 2018-10-25 11:47:03 +00:00
matthijskooijman (Migrated from github.com) commented 2018-10-25 11:47:03 +00:00

I've moved this check into index.php, so it can incorporate the root url. This fixes an infinite redirect when trying to access e.g. /en/SomePage without a datafile, which would redirect to /en/hypha.php, which would keep redirecting to itself.

I've moved this check into index.php, so it can incorporate the root url. This fixes an infinite redirect when trying to access e.g. /en/SomePage without a datafile, which would redirect to /en/hypha.php, which would keep redirecting to itself.
matthijskooijman commented 2018-10-25 12:44:42 +00:00 (Migrated from github.com)

I've made some more small changes (as commented) and force pushed to this branch. As far as I'm concerned, this PR is ready for merging. I'll leave it to you guys tonight to do a final review and do the actual merge.

I've made some more small changes (as commented) and force pushed to this branch. As far as I'm concerned, this PR is ready for merging. I'll leave it to you guys tonight to do a final review and do the actual merge.
tammoterhark commented 2018-10-29 15:31:33 +00:00 (Migrated from github.com)

Wie durft er op de knop te drukken?

Wie durft er op de knop te drukken?
matthijskooijman commented 2018-10-29 16:00:47 +00:00 (Migrated from github.com)

Ik! Gemerged :-D

Ik! Gemerged :-D
tammoterhark commented 2018-10-29 16:21:01 +00:00 (Migrated from github.com)

Top. Great step for mankind!

Top. Great step for mankind!
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
harmen/hypha!85
No description provided.