-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PageImages support for mode=gallery on non file pages #275
Conversation
Important Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Extra context: This was originally written around 2022 for a wiki in MW1.35. During a recent update cleaned up the code a bit and tested it on a blank install of MW1.41. |
$img = $repoGroup->findFile( Title::makeTitle( NS_FILE, $pageImage ) ); | ||
if ( $img && $img->exists() ) { | ||
$imageUrl = $img->getURL(); | ||
} else { |
Check warning
Code scanning / Phpmd (reported by Codacy)
Use return statements instead of else expression Warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good, just some formatting things. I apologize if I am being over picky about it.
Co-authored-by: CosmicAlpha <[email protected]>
Co-authored-by: CosmicAlpha <[email protected]>
Co-authored-by: CosmicAlpha <[email protected]>
Co-authored-by: CosmicAlpha <[email protected]>
Co-authored-by: CosmicAlpha <[email protected]>
Co-authored-by: CosmicAlpha <[email protected]>
Co-authored-by: CosmicAlpha <[email protected]>
Co-authored-by: CosmicAlpha <[email protected]>
Co-authored-by: CosmicAlpha <[email protected]>
Co-authored-by: CosmicAlpha <[email protected]>
Co-authored-by: CosmicAlpha <[email protected]>
Co-authored-by: CosmicAlpha <[email protected]>
Co-authored-by: CosmicAlpha <[email protected]>
Co-authored-by: CosmicAlpha <[email protected]>
Co-authored-by: CosmicAlpha <[email protected]>
Co-authored-by: CosmicAlpha <[email protected]>
Co-authored-by: CosmicAlpha <[email protected]>
Co-authored-by: CosmicAlpha <[email protected]>
Co-authored-by: CosmicAlpha <[email protected]>
Co-authored-by: CosmicAlpha <[email protected]>
Co-authored-by: CosmicAlpha <[email protected]>
Co-authored-by: CosmicAlpha <[email protected]>
…try to alphabetical order
Thank you for all the fixes and formatting! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Went through them, I think I got them all. Should I try removing the else branches that the GH bot is complaining about or are those fine to stay?
$img = $repoGroup->findFile( Title::makeTitle( NS_FILE, $pageImage ) ); | ||
if ( $img && $img->exists() ) { | ||
$imageUrl = $img->getURL(); | ||
} else { |
Check warning
Code scanning / Phpmd (reported by Codacy)
Use return statements instead of else expression Warning
// Failed to get a page image | ||
$item = $this->getItemStart() . $item . $this->itemEnd . '[[' . $item . ']]'; | ||
} | ||
} else { |
Check warning
Code scanning / Phpmd (reported by Codacy)
Use return statements instead of else expression Warning
if ( $pageImage ) { | ||
// Successfully got a page image, wrapping it | ||
$item = $this->getItemStart() . $pageImage . '| [[' . $item . ']]' . $this->itemEnd . 'link=' . $item; | ||
} else { |
Check warning
Code scanning / Phpmd (reported by Codacy)
Use return statements instead of else expression Warning
df4ff96
into
Universal-Omega:master
In gallery mode, attempting to automatically detect whether:
If both are true, it should try to use the PageImage for the gallery and the page name for the image caption.
Right now, it also makes the page name in the caption a link, and points the image link to the page as well. Could not figure out how to make this behavior optional.
Gallery mode for file pages should be untouched.
Notes: