Commit graph

17767 commits

Author SHA1 Message Date
Andre Klapper 4d98c0a455 Replace some AphrontView::setUser() calls with AphrontView::setViewer()
Summary:
See rPaaab1011e5a464ea94c182001a7fe867b19bae5a.
`AphrontView::setUser()` is deprecated.
Save a few CPU cycles and nuclear power plants.

Test Plan:
Read the code.
Even better, intentionally introduce an error in `AphrontView::setUser()`
and browse random Phorge pages and then replace the call accordingly (as
there are numerous `setUser()` methods across the codebase and we don't
want no explosions).

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25880
2025-04-13 00:45:55 +02:00
Benjamin Kausch d3cbfd952e Fix overflowing of AphrontSideNavFilterView on small screens and tidy up nav bar styles
Summary:
Switch the two column layout of AphrontSideNavFilterView (used in pretty much most views) from table to flex display. The former CSS rendering could lead to overflowing of the entire page on small screens if very wide unbreaking content is displayed (example described here: T15809).

While I was at it I have found some unused code. The CSS file `phabricator-nav-view.css` consisted almost only of `.phabricator-side-menu-home` class selectors. This is an ancient class (there at least since 2013) not used anymore:

https://we.phorge.it/source/phorge/browse/master/src/applications/directory/controller/PhabricatorDirectoryController.php;919bd4a03499305093d8882952a9dd3dac1c55a9$169

So I have removed this CSS component and saved the few still used declarations to the main `phui-basic-nav-view.css`.

There was some unused code in `AphrontSideNavFilterView.php` too.

Fixes T15809

Test Plan:
Look at this video to understand the problem:

F2178277

Go in a Task comment and mention a task with a very-long title. Have phd enabled to generate feeds. Visit homepage with feeds:

See that you cannot reproduce anymore.

Browse pages with the right nav bar with many devices and look if the layout looks fine and not broken.

Tested the homepage, scaling from mobile to desktop, using:

- Firefox 124 64bit on GNU/Linux (snap)
- Chromium 124 64bit on GNU/Linux (snap)
- ...

Tested other elements, scaling from mobile to desktop, still working correctly:

- popup dialogs
- right floating menu
- top curtain
    - notifications
    - Conpherence chats
    - unresolved setup issues
    - search omnibox

Reviewers: O1 Blessed Committers, aklapper

Reviewed By: O1 Blessed Committers, aklapper

Subscribers: aklapper, speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15809

Differential Revision: https://we.phorge.it/D25619
2025-04-12 14:12:14 +02:00
Andre Klapper 12991c0d37 Fix overlapping elements in Phame for >1791px width
Summary:
Regression from rP9448e815721c882196b8c541560270734574af8e.

Closes T15985

Test Plan:
For both a viewport width >1791px and below,
* Go to the Phriction wiki page http://phorge.localhost/w/blah which has sections so a table of contents is displayed
* Go to http://phorge.localhost/phame/ and with no blogs visible to the current user or no existing blogposts
* Go to http://phorge.localhost/phame/ with existing/visible blogposts, see no overlap of horizontal lines and Blogs box
* Go to an empty blog at http://phorge.localhost/phame/blog/view/4/
* Go to an existing blogpost at http://phorge.localhost/phame/post/view/1/whatever/
* Go to an existing blogpost at http://phorge.localhost/phame/post/view/1/whatever/ which includes a full width image via `{F1234,size=full}`
* Go to http://phorge.localhost/book/phorge/article/remarkup/
* Go to http://phorge.localhost/w/

Reviewers: O1 Blessed Committers, mturdus, avivey

Reviewed By: O1 Blessed Committers, mturdus, avivey

Subscribers: mturdus, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15985

Differential Revision: https://we.phorge.it/D25873
2025-04-11 10:54:06 +02:00
Merula Turdus 99834dd061 Fix PHP 8.1 "strlen(null)" exception on auth email message body when PhabricatorAuthMessage is unset
Summary:
This is a fix for running Phorge on PHP 8.2+. Other fixes were already merged.

Closes T15536

Test Plan: Unclear.

Reviewers: O1 Blessed Committers, avivey, aklapper

Reviewed By: O1 Blessed Committers, avivey, aklapper

Subscribers: aklapper, avivey, speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Tags: #php_8_support

Maniphest Tasks: T15064, T15536

Differential Revision: https://we.phorge.it/D25256
2025-04-09 09:18:58 +02:00
mainframe98 0f7e76ffe4 Remove support for PHP mysql extension
Summary:
This extension was deprecated in PHP 5.5.0 and removed in PHP 7.0.0.
Given the requirement of PHP 7.2, it makes no sense to support this
extension.

Closes T16024

Test Plan: Grep for both `mysql` and `mysqli` and look for outdated references.

Reviewers: O1 Blessed Committers, aklapper

Reviewed By: O1 Blessed Committers, aklapper

Subscribers: aklapper, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16024

Differential Revision: https://we.phorge.it/D25946
2025-04-08 18:53:59 +02:00
Andre Klapper 75d8c84c13 PHPDoc: Make some parameter types match type in signatures
Summary: For explicitly mentioned Phorge class types in the function signature, use the same type in the PHPDoc for the parameter.

Test Plan: Compare classname type in function signature and in PHPDoc; run static code analysis.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25937
2025-04-08 11:00:33 +02:00
Andre Klapper bf39f021d6 PhabricatorCustomField: Fix a typo in PHPDoc
Summary: Trivial typo fix.

Test Plan: Read slowly.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25941
2025-04-08 11:00:08 +02:00
Andre Klapper ef3e0a75f6 Fix PHP 8.1 "strlen(null)" exception in Feed setting up MFA
Summary:
`strlen()` was used in Phabricator to check if a generic value is a non-empty string.
This behavior is deprecated since PHP 8.1. Phorge adopts `phutil_nonempty_string()` as a replacement.

Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.

```
ERROR 8192: strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [/var/www/html/phorge/phorge/src/applications/auth/xaction/PhabricatorAuthFactorProviderNameTransaction.php:20]
```

Closes T15992

Test Plan: After applying the changes, go to http://phorge.localhost/feed/transactions/ and check the entries related to setting up an MFA provider.

Reviewers: O1 Blessed Committers, slip, avivey

Reviewed By: O1 Blessed Committers, slip, avivey

Subscribers: slip, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15992

Differential Revision: https://we.phorge.it/D25867
2025-04-08 10:59:28 +02:00
Andre Klapper 964b1d4b3d Complete session digest migration from SHA1 to SHA256
Summary:
Followup to 1d34238dc9.
Crossing fingers that nobody complains about a one-time logout after their six year long user session.

Closes T16025

Test Plan:
* Log in, log out, do stuff.
* More specifically, with my session expired, successfully logging in created a database row added to `phabricator_user.phabricator_session` as expected, and logout removed the row.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: avivey, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16025

Differential Revision: https://we.phorge.it/D25949
2025-04-07 23:46:06 +02:00
Andre Klapper d5ade92fd0 Remove several unused private functions
Summary: These private functions are not called within their class.

Test Plan:
Grep; run static code analysis.

Additionally, this still works:

arc unit src/applications/conpherence/__tests__/ConpherenceRoomTestCase.php

These pages still work:

/conpherence/search/

/differential/

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25933
2025-04-07 22:14:35 +02:00
Andre Klapper 969904e7fa Remove setup check for safe_mode removed in PHP 5.4
Summary:
Phorge requires PHP 7.2 so don't check for stuff removed in PHP 5.4.
See https://www.php.net/releases/5_4_0.php and https://web.archive.org/web/20190217003515/https://php.net/features.safe-mode

Test Plan: Set up Phorge, I'd guess.

Reviewers: O1 Blessed Committers, mainframe98, avivey

Reviewed By: O1 Blessed Committers, mainframe98, avivey

Subscribers: mainframe98, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25947
2025-04-07 22:12:47 +02:00
Andre Klapper adc199eb4a Remove setup check for PHP 7.0
Summary: Phorge requires PHP 7.2 so don't check for PHP 7.0.

Test Plan: Set up Phorge, I guess.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25948
2025-04-05 16:02:54 +02:00
Andre Klapper 17033a1c70 Fix exception handling a numeric git branch ("Call to phutil_nonempty_string() expected null or a string, got: int" in PhabricatorRepository)
Summary:
PHP casts an array key which is a string that contains a decimal integer automatically into int type.
Quoting https://www.php.net/manual/en/language.types.array.php#language.types.array.syntax: "Strings containing valid decimal ints, unless the number is preceded by a + sign, will be cast to the int type."

As we check git branch names via `phutil_nonempty_string($key)`, this throws an exception.
Thus explicitly cast the int to string.

Closes T15640.

Test Plan:
* Have a git repository with a branch whose name consists of digits only and does not start with 0.
* Go to a commit which belongs both to the main/master branch and  such a numeric branch via http://phorge.localhost/diffusion/ABCD/branches/main/;1234567890abcdef1234567890abcdef12345678
* Additionally, visit the commit and see that the "Branches" does not load as it also belongs to a numeric branch.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15640

Differential Revision: https://we.phorge.it/D25945
2025-04-02 15:09:20 +02:00
Andre Klapper def09cf442 PHPDoc: Replace non-existing return type phid with string
Summary:
`phid` is not a valid type. See https://docs.phpdoc.org/guide/references/phpdoc/types.html and https://docs.phpdoc.org/guide/references/phpdoc/tags/return.html.
Thus return `string` and get less errors reported by PHPStan.

Test Plan: Read docs; run static code analysis.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25944
2025-04-02 01:15:03 +02:00
Andre Klapper b302851369 PHPDoc: Replace non-existing param type phid with string
Summary:
`phid` is not a valid type. See https://docs.phpdoc.org/guide/references/phpdoc/types.html.
Thus set the param type to `string` and get a few less errors reported by PHPStan.

Test Plan: Read docs; run static code analysis.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25940
2025-03-31 22:52:42 +02:00
Andre Klapper abb0d6815a PHPDoc: Replace non-existing param type const with string
Summary:
`const` is not a valid type. See https://docs.phpdoc.org/guide/references/phpdoc/types.html and https://docs.phpdoc.org/guide/references/phpdoc/tags/return.html.
Thus set the param type to `string` and get a few less errors reported by PHPStan.

Test Plan: Read docs; run static code analysis.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25938
2025-03-31 22:01:08 +02:00
Cigaryno MD f6639cc09c Update TOTP suggestions to open-source applications
Summary:
Replaces Authy and Google Authenticator, both proprietary with FreeOTP, Bitwarden Authenticator, Aegis, and 2FAS, all free and open-source.
Closes T16018

Test Plan:
- Setup TOTP factor in the Auth app.
- Setup the TOTP factor on your account.
- On both, **double check** the text for any typo or missing app. If any, click on {nav Request Changes}.

Reviewers: O1 Blessed Committers, aklapper

Reviewed By: O1 Blessed Committers, aklapper

Subscribers: aklapper, Cigaryno, tobiaswiese, valerio.bozzolan, Matthew

Tags: #auth, #user-cigaryno

Maniphest Tasks: T16018

Differential Revision: https://we.phorge.it/D25934
2025-03-31 14:53:24 +01:00
Andre Klapper a9c6ea4773 PHPDoc: Replace non-existing return type const with string
Summary:
`const` is not a valid type. See https://docs.phpdoc.org/guide/references/phpdoc/types.html and https://docs.phpdoc.org/guide/references/phpdoc/tags/return.html.
Thus return `string` and get 82 less errors reported by PHPStan.

Test Plan: Read docs; run static code analysis.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25932
2025-03-29 12:38:40 +01:00
xtex a81f20e0f2
Config: Fix git errors when .git does not exist
Summary: Bug: T16023

Test Plan: Delete `.git` and visit `/config/`

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16023

Differential Revision: https://we.phorge.it/D25931
2025-03-28 23:59:40 +08:00
Andre Klapper 06a62b347a Fix invalid CSS overflow value for .phui-oi-name
Summary:
The W3C CSS validator throws `Value Error : overflow normal is not a overflow value : normal`.
`normal` is not a valid value for `overflow`, as browsers currently cannot parse it they fall back to the default `visible`, thus change it to `visible`.
See https://developer.mozilla.org/en-US/docs/Web/CSS/overflow

Test Plan:
Paste `phui-oi-list-view.css` into https://jigsaw.w3.org/css-validator/ and read some CSS docs.

Also, visit a page showing a PHUIObjectItemView, like the /phame/post/ page, and
have a object with a veeeeeery long name, and see absolutely no difference A/B,
both on desktop, medium and small screens.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25921
2025-03-28 11:23:10 +01:00
Andre Klapper 64044ab830 Remove more obsolete IE9 filter CSS syntax
Summary:
Same game as rPe38f5457 but hadn't realized before:
IE5.5 to IE8 released 03/2009 supported the `filter: alpha()` syntax.
(IE8 and IE9 supported `-ms-filter` which was deprecated in IE9 and is unsupported since IE10 released 09/2012.)
See
* https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/ms532847(v=vs.85)
* https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/ms532967(v=vs.85)
* https://learn.microsoft.com/en-us/previous-versions/ms530752(v=vs.85)
* https://stackoverflow.com/questions/40389599/firefox-declaration-dropped-errors

`filter` is a valid standard CSS3 property unrelated to IE's obsolete `filter: alpha()` syntax.
Standard `filter` does not support `alpha()` per https://developer.mozilla.org/en-US/docs/Web/CSS/filter.
Thus modern browsers throw errors in the console to be avoided by removing this old syntax.

Test Plan: Read the links above, realize it's been 16 years, and agree with me.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25930
2025-03-28 10:57:51 +01:00
Andre Klapper 112174b900 Remove some pre-2013 vendor-prefixed -ms- CSS properties
Summary:
Per https://caniuse.com/ and MDN,
* `-ms-transform` superseded by unprefixed `transform` supported since IE 10 released 09/2012
* `@-ms-keyframes` superseded by unprefixed `@keyframes` supported since IE 10 released 09/2012
* `-ms-transition` superseded by unprefixed `transition` supported since IE 10 released 09/2012

Test Plan: None. Probably installing old browser versions if you don't trust documentation.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25928
2025-03-28 06:57:42 +01:00
Andre Klapper e38f545743 Remove obsolete IE9 filter CSS syntax
Summary:
IE5.5 to IE8 released 03/2009 supported the `filter: progid:DXImageTransform.Microsoft.BasicImage()` syntax.
(IE8 and IE9 supported `-ms-filter` which was deprecated in IE9 and is unsupported since IE10 released 09/2012.)
See
* https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/ms532847(v=vs.85)
* https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/ms532967(v=vs.85)
* https://learn.microsoft.com/en-us/previous-versions/ms530752(v=vs.85)
* https://stackoverflow.com/a/5705449

`filter` is a valid standard CSS3 property unrelated to IE's obsolete `filter: progid: DXImageTransform.Microsoft.BasicImage()` syntax. Thus modern browsers throw errors in the console to be avoided by removing this old syntax.

Test Plan: Read the links above, realize it's been 16 years, and agree with me.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25929
2025-03-28 06:50:49 +01:00
Andre Klapper 0470216497 Remove pre-2016 vendor-prefixed -webkit- CSS properties
Summary:
Per https://caniuse.com/ and MDN,
* `-webkit-border-radius` superseded by unprefixed `border-radius` supported since Chrome 5 released 05/2010, Safari 5 09/2010, Android Browser 2.2 05/2010
* `-webkit-box-shadow` superseded by unprefixed `box-shadow` supported since Chrome 10 released 03/2011, Safari 5.1 03/2012,  Android Browser 4 10/2011
* `-webkit-box-sizing` superseded by unprefixed `box-sizing` supported since Chrome 10 released 03/2011, Safari 5.1 03/2012,  Android Browser 4 10/2011
* `-webkit-transform` superseded by unprefixed `transform` supported since Chrome 36 released 07/2014, Safari 9 10/2015,  Android Browser >4.4.4 >07/2014
* `-webkit-transition` superseded by unprefixed `transition` supported since Chrome 26 released 02/2013, Safari 9 10/2015,  Android Browser 4.4 12/2013

Test Plan: None. Probably installing old browser versions if you don't trust documentation.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25927
2025-03-27 08:33:12 +01:00
Andre Klapper 29866413d1 Diviner: Contributing Code: Update section on Prototype Changes
Summary:
Per discussion in T16007 I hope that we can agree on this phrasing.

Closes T16007

Test Plan: Look at the reality out there.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16007

Differential Revision: https://we.phorge.it/D25909
2025-03-26 17:14:57 +01:00
Andre Klapper 97605e6aa9 Apply "Can Bulk Edit Tasks" to "Move Tasks" workboard options
Summary: The "Can Bulk Edit Tasks" Maniphest application setting introduced in rP7fedfacbca27c165cf193f286cef9306cf9762e2 applies to the "Bulk Edit Tasks…" menu item in the project workboard column dropdown. Make it also apply to the menu items "Move Tasks to Column…" and "Move Tasks to Project…" as those are similar actions.

Test Plan:
1. Go to `/applications/view/PhabricatorManiphestApplication/` and set `Can Bulk Edit Tasks` to `Administrators`
2. Go to `/project/board/1/` and create a second column
3. As a default user, open the column header dropdown of the default column on `/project/board/1/`
4. Select `Bulk Edit Tasks…` (no changes in behavior)
5. Select `Move Tasks to Column…`; select `Move Tasks to Project…`, don't succeed.
6. Try step 5 again as an administrator, succeed.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25912
2025-03-26 14:23:43 +01:00
Andre Klapper f62918b019 Fix invalid CSS vertical-align value for .fancy-datepicker-core
Summary:
`vertical-align: center` is not a valid value per https://developer.mozilla.org/en-US/docs/Web/CSS/vertical-align.
Likely `middle` was meant.

Test Plan: Read CSS docs; check output of your web browser console. (Interstingly, https://jigsaw.w3.org/css-validator/validator does not complain.)

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25920
2025-03-25 14:28:08 +01:00
Andre Klapper a8c2bce6fe Remove invalid CSS border-shadow property for input.jx-tokenizer-input
Summary:
The W3C CSS validator throws `Property border-shadow doesn't exist : none` as that property does not exist.
See 404 on https://developer.mozilla.org/en-US/docs/Web/CSS/border-shadow

Test Plan: Paste `phui-oi-list-view.css` into https://jigsaw.w3.org/css-validator/; find no CSS docs for that property.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25924
2025-03-25 12:37:47 +01:00
Andre Klapper 633d4037e5 Fix invalid CSS border-left-color value for .phabricator-action-view-submenu .caret-right
Summary:
The W3C CSS validator throws `Value Error : border-left-color Too many values or values are not recognized : 71,87,120`.
The value lacks `rgb()` wrapping. See other lines in the same CSS file.

Test Plan: Paste celerity processed `phui-action-list.css` into https://jigsaw.w3.org/css-validator/; look at the browser console while editing a task.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25925
2025-03-25 12:03:13 +01:00
Andre Klapper 56797b17ed Herald actions: Allow setting subtype on Maniphest tasks
Summary:
https://secure.phabricator.com/T12314 introduced task subtypes. Allow Herald rules which change/set the subtype of a task.
Code originally written by @20after4 for Wikimedia.

Closes T16022

Test Plan:
1. Have the default subtype configuration with three types under http://phorge.localhost/config/edit/maniphest.subtypes/ defined in src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php
2. Go to http://phorge.localhost/herald/edit/?content_type=HeraldManiphestTaskAdapter&rule_type=global
3. Under "Action", select the new "Change subtype to" option. Test the subtype search by clicking the magnifier icon, set up a Herald rule to test execution.
4. Remove the config for http://phorge.localhost/config/edit/maniphest.subtypes/
5. Repeat step 3, no explosions, default "Task" subtype still exists after removing the config.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, 20after4, Cigaryno

Maniphest Tasks: T16022

Differential Revision: https://we.phorge.it/D25913
2025-03-25 10:35:19 +01:00
Andre Klapper fcd6a4c28a Fix invalid CSS transition value for .jx-scrollbar-handle
Summary:
The W3C CSS validator throws `0 is not a transition value : opacity 0 linear`.
`0` is not a valid value; likely `0s` were meant as in other existing CSS definitions.
See https://developer.mozilla.org/en-US/docs/Web/CSS/transition

Test Plan: Paste `standard-page-view.css` into https://jigsaw.w3.org/css-validator/ and read some CSS docs.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25923
2025-03-25 10:29:22 +01:00
Andre Klapper fede9f4505 Fix invalid CSS cursor value for .phabricator-main-menu-brand
Summary:
The W3C CSS validator throws `Value Error : cursor hand is not a cursor value : hand`.
`hand` is not a valid value for `cursor`; likely `pointer` was meant.
See https://developer.mozilla.org/en-US/docs/Web/CSS/cursor

Test Plan: Paste `main-menu-view.css` into https://jigsaw.w3.org/css-validator/ and read some CSS docs.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25922
2025-03-25 10:25:11 +01:00
Andre Klapper 22147cc03b Remove pre-2013 vendor-prefixed -o- CSS properties
Summary:
Per https://caniuse.com/ and MDN,
* `-o-animation` superseded by unprefixed `animation` supported initially since Opera 12.1 released 11/2012, in later Opera versions with `-webkit-` prefix instead
* `@-o-keyframes` superseded by unprefixed `@keyframes` supported initially since Opera 12.1 released 11/2012, in later Opera versions with `-webkit-` prefix instead
* `-o-transform` superseded by unprefixed `transform` supported initially since Opera 12.1 released 11/2012
* `-o-transition` superseded by unprefixed `transition` supported initially since Opera 12.1 released 11/2012

Test Plan: None. Probably installing old browser versions if you don't trust documentation.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25916
2025-03-24 12:06:40 +01:00
Andre Klapper 8353146b04 Remove pre-2013 vendor-prefixed -moz- CSS properties
Summary:
Per https://caniuse.com/ and MDN,
* `-moz-opacity` superseded by unprefixed `opacity` supported since Firefox 2 released 10/2006
* `-moz-border-radius` superseded by unprefixed `border-radius` supported since Firefox 4 released 03/2011
* `-moz-box-shadow` superseded by unprefixed `box-shadow` supported since Firefox 4 released 03/2011
* `-moz-animation` superseded by unprefixed `animation` supported since Firefox 16 released 08/2012
* `-moz-backface-visibility` superseded by unprefixed `backface-visibility` supported since Firefox 16 released 08/2012
* `@-moz-keyframes` superseded by unprefixed `@keyframes` supported since Firefox 16 released 08/2012
* `-moz-transform` superseded by unprefixed `transform` supported since Firefox 16 released 08/2012

Test Plan: None. Probably installing old browser versions if you don't trust documentation.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25915
2025-03-24 12:03:21 +01:00
Andre Klapper 645b1f5a99 Remove pre-2005 vendor-prefixed -khtml- CSS property
Summary:
Remove `-khtml-opacity: 0.5;` from CSS.
Per https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariCSSRef/Articles/StandardCSSProperties.html, standard `opacity` has been supported since Safari 2.0 released in April 2005. If you still run Safari 1.x after 20 years you have bigger problems than this line of CSS in Phorge.
This is the only `-khtml-` prefixed property in the codebase.

Test Plan: None.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25914
2025-03-24 08:59:40 +01:00
Andre Klapper ad7560b364 AphrontFormPolicyControl: Reuse existing control ID
Summary:
Do not unconditionally create a new ID which breaks the accessibility label.

Parent `AphrontFormControl::render()` set an ID via `$this->setID(celerity_generate_unique_node_id())` and then calls `$this->renderInput()` on its subclass `AphrontFormPolicyControl` which unconditionally runs `$control_id = celerity_generate_unique_node_id()` to assign another ID and then does `'id' => $control_id`.
This breaks accessibility (AphrontFormControl's `label for="UQ0_xx"` is now off by one from AphrontFormPolicyControl's `a id="UQ0_xx"`).

Similar existing code can be found in `AphrontFormTokenizerControl::renderInput()` at https://we.phorge.it/source/phorge/browse/master/src/view/form/control/AphrontFormTokenizerControl.php;bccd4f5981a7e2c347e8e26cf24d8394c882724f$57-61

Closes T16019

Test Plan: Create a Maniphest Task form which exposes policy controls. Check the resulting HTML if `<label for="">` and `<a id="">` match.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16019

Differential Revision: https://we.phorge.it/D25910
2025-03-23 10:12:07 +01:00
sten 3e2d5e4bac Fix PHP8.1 strlen(null) error in DivinerArticleAtomizer.php
Summary:
Fix the strlen(null) error in DivinerArticleAtomizer.php

Fixes T16012

Test Plan:
Create Test.book and test.md as per T16012, then run:
```
/phorge/bin/diviner generate --book Test.book
```

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16012

Differential Revision: https://we.phorge.it/D25907
2025-03-14 09:10:57 +00:00
Andre Klapper c8e3ee170f Charts: Rotate x-axis labels for better readability
Summary:
Rotation is a fundamental movement pattern in our every-day activities.
Whether we play Spin The Bottle at our birthday, change our keyboard layout regularly, or do a sumersault to roll back into bed after our hair of the dog, we all regularly rely on rotation.
Thus also apply this principle to chart labels.

All credits go to http://www.d3noob.org/2013/01/how-to-rotate-text-labels-for-x-axis-of.html

Closes T16013

Test Plan:
# Go to `/project/reports/1/` after having constant task activity within that project tag for a while
# Try different viewport widths
# Take a deep breath and admit that the x-axis labels are more readable than before

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16013

Differential Revision: https://we.phorge.it/D25908
2025-03-14 08:26:31 +01:00
ekubischta 1552925d41 Add the Jxxx Monogram to Phame Post Tab Titles for logged-in users
Summary:
This revision brings Phame Posts inline with other objects like Tasks, Revisions, Passphrase, etc. which all place the Monogram into the browser tab title

This improves useability of Phame Posts by making it easier to reference them in other parts of Phorge

**Old Look**
{F22364 size=full}

**New Look**
{F22365 size=full}

Test Plan:
Made a post, be logged-in, saw the Monogram in the title (as usual in other apps like Maniphest).

See same post as logged-out (or be a search engine), saw just the title (so your SEO consultant is still happy).

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: Cigaryno, bekay, speck, tobiaswiese, valerio.bozzolan

Tags: #phame

Maniphest Tasks: T15050

Differential Revision: https://we.phorge.it/D25022
2025-03-13 13:11:27 +00:00
ekubischta 5bd99a394a Add instructions to Create Repository form fields for Callsign and Short Name
Summary:
When I create new repos, I always forget which is which (between Callsign and Short Name)

This adds helpful text as a placeholder and as control instructions

I am not sure if this layout is 100% better, but this is an option as well

**Add new Repository**
{F3169761 width=800}

**Edit existing Repository**
{F3169775 width=800}

Closes T15742

Test Plan: Added a new repository and saw these control instructions

Reviewers: O1 Blessed Committers, aklapper

Reviewed By: O1 Blessed Committers, aklapper

Subscribers: aklapper, avivey, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15742

Differential Revision: https://we.phorge.it/D25898
2025-03-11 13:11:52 +00:00
Andre Klapper fa00599de5 Facts and Charts: Add more PHPDoc coverage
Summary: Make things a bit easier to understand.

Test Plan: Check parameters and return values for types and classes.

Reviewers: O1 Blessed Committers, Cigaryno, valerio.bozzolan

Reviewed By: O1 Blessed Committers, Cigaryno, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25906
2025-03-09 11:12:15 +01:00
mainframe98 955ec77760 Fix packages base uri and introduce a console for that base uri
Summary:
The packages base uri is /packages/.
Previously, the base uri pointed to the packages search engine.
Because that prevents navigating to the publishers search engine
and the versions search engine and because the new base uri is a 404,
add a console, similar to Almanac or Nuance to link to these
endpoints. This makes the forms for publishers and versions
accessible without manually navigating there.

Test Plan:
* Clicked on the Packages application in Applications and saw a Console
* Clicked on the options in the console and saw all search engines
* Clicked on the packages crumb and got sent to the console
* Created a package and clicked on Edit Package and didn't see a 404

Reviewers: O1 Blessed Committers, aklapper

Reviewed By: O1 Blessed Committers, aklapper

Subscribers: aklapper, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25881
2025-03-06 19:43:14 +01:00
mainframe98 e99e9a3003 PhabricatorLiskDAO: Fragment serializer cache by class
Summary:
This restores the pre-PHP 8.1 behavior, where values of
static variables within inherited methods were independent
of each other. With PHP 8.1, this was changed to be truly
'static', which causes problems when one derivate of
PhabricatorLiskDAO defines a custom serializer but another
does not.

This came to light in T15726, but only for the Fund application,
which is a prototype, and deprecated. This fixes Fund, but
more importantly, everything else that would be broken by
this, whatever it was.

Ref: https://wiki.php.net/rfc/static_variable_inheritance

Previous stacktrace:
```
EXCEPTION: (RuntimeException) Undefined array key "totalAsCurrency" at [<arcanist>/src/error/PhutilErrorHandler.php:273]
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php:345]
  #1 <#2> PhabricatorLiskDAO::willWriteData(array) called at [<phorge>/src/infrastructure/storage/lisk/LiskDAO.php:1085]
  #2 <#2> LiskDAO::insertRecordIntoDatabase(string) called at [<phorge>/src/infrastructure/storage/lisk/LiskDAO.php:958]
  #3 <#2> LiskDAO::insert() called at [<phorge>/src/infrastructure/storage/lisk/LiskDAO.php:927]
  #4 <#2> LiskDAO::save() called at [<phorge>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:1405]
  [...]
```

Test Plan:
On PHP 8.1+:
1. Visit http://phorge.localhost/applications/ and enable the deprecated prototype applications "Fund" and "Phortune" via "Configure"
2. Visit http://phorge.localhost/phortune/merchant/edit/ and create a merchant
3. Visit http://phorge.localhost/fund/create/ and click the "Create New Initiative" button

Reviewers: O1 Blessed Committers, aklapper, valerio.bozzolan

Reviewed By: O1 Blessed Committers, aklapper, valerio.bozzolan

Subscribers: aklapper, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15064

Differential Revision: https://we.phorge.it/D25859
2025-03-04 17:55:02 +01:00
Andre Klapper 38e359cb13 Fix non-existing log method in HarbormasterManagementRestartWorkflow
Summary: In `HarbormasterManagementRestartWorkflow`, `logSkip()` is called. A method with such a name has never existed in `PhabricatorManagementWorkflow`. Given the five available `log*()` methods, replace the call with `logInfo()` which seems most appropriate.

Test Plan: Run static code analysis which complains about `Call to an undefined method HarbormasterManagementRestartWorkflow::logSkip()`; read the code.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Tags: #almanac_drydock_harbormaster

Differential Revision: https://we.phorge.it/D25742
2025-03-03 16:16:16 +01:00
Andre Klapper 0f4ab2413d ManiphestReportController: Add more PHPDoc coverage
Summary: Make things a bit easier to understand, for the start.

Test Plan: Check return values for their types and classes.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25901
2025-03-03 15:52:54 +01:00
Andre Klapper 4f3aad4f9f Portals: Rename unused newNoMenuItemsView() to newNoContentView()
Summary:
Followup to rPf8b8d88

Rename uncalled `newNoMenuItemsView()` to `newNoContentView()` overwriting this method in the parent class, to fix showing more specific UI messages for empty portals.

Test Plan:
Code:
* Grep the code for non-existing `newNoMenuItemsView`
* Check code of parent class `PhabricatorProfileMenuEngine`
Workflows:
* Create an empty portal via http://phorge.localhost/portal/edit/form/default/, see correct (more specific) string "Use "Edit Menu" to add menu items to this portal." displayed
* Click "Edit Menu" to go to http://phorge.localhost/portal/view/1/configure/global/ of that Portal just created, on the right in "Add New Menu Item..." select "Divider" and click "Create Menu Item" button, go back to portal, see correct (more specific) string "None of the visible menu items in this portal can render any content." displayed

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Tags: #dashboards

Differential Revision: https://we.phorge.it/D25776
2025-03-01 20:15:28 +01:00
Andre Klapper 883ec909cc Replace some http://www.php.net URIs with https://www.php.net
Summary: Faster, happier, more productive.

Test Plan: Click 'em all.

Reviewers: O1 Blessed Committers, Cigaryno, valerio.bozzolan

Reviewed By: O1 Blessed Committers, Cigaryno, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25896
2025-02-25 15:15:12 +01:00
Andre Klapper e3aeed5b5d Run ./bin/celerity map
Summary:
I have no freaking idea what I'm doing wrong. I did manually rebase
for the merge conflict before pushing fd6118bfa6. Sorry again.

Test Plan: Run `./bin/celerity map`

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25893
2025-02-21 14:26:06 +01:00
Andre Klapper abeeadd6b0 Check that min epoch < max epoch in PhabricatorFeedQuery::withEpochInRange()
Summary:
`PhabricatorFeedQuery::withEpochInRange()` returns zero results when passing parameters in the wrong order.
Instead return a PhutilArgumentUsageException which makes it clear why there are no results.

Test Plan:
On an early morning without coffee supply, write custom code like
```
$query = id(new PhabricatorFeedQuery())
         ->setViewer(PhabricatorUser::getOmnipotentUser())
         ->withFilterPHIDs(array($user->getPHID()))
         ->withEpochInRange(time(), time() - 86400)
         ->setReturnPartialResultsOnOverheat(true);
$stories = $query->execute();
```
and wonder why you get zero results. Optionally, feel stupid for a moment.
Apply patch, now get an "Unhandled Exception ("PhutilArgumentUsageException") - Minimum range must be lower than maximum range."

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25891
2025-02-20 19:31:04 +01:00
Andre Klapper fd6118bfa6 Fix editing Conpherence rooms on mobile
Summary:
rPd6bce34a5db1a838a988440f09f7728747c9e067 failed to replace all occurrences of `$this->getApplicationURI('update/'.$conpherence->getID().'/')` with `$this->getApplicationURI('edit/'.$conpherence->getID().'/')`. Thus editing a Conpherence room on mobile crashes due to using an old invalid path.

Closes T15513

Test Plan:
* Run `grep -r "update/" . | grep onpherenc` vs `grep -r "edit/" . | grep onpherenc` and read rPd6bce34a5db1a838a988440f09f7728747c9e067
* Go to a Conpherence room in mobile view and select "Edit Room"
* Go to a Conpherence room in desktop view and select "Edit Room"

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15513

Differential Revision: https://we.phorge.it/D25879
2025-02-20 19:19:04 +01:00