Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideMoves and expands language loading so update-related language keys (including lib_joomla) are initialized before extension updates are fetched and displayed in the CLI command, instead of only loading com_installer after rendering the table. Sequence diagram for updated language loading in UpdatefromcliCommand executionsequenceDiagram
actor CliUser
participant SymfonyConsole as SymfonyConsole_Application
participant UpdatefromcliCommand as UpdatefromcliCommand
participant JoomlaApp as Joomla_Application
participant Language as Language
participant InstallerComponent as Com_installer_Component
participant UpdateModel as UpdateModel
CliUser->>SymfonyConsole: run updatefromcli command
SymfonyConsole->>UpdatefromcliCommand: doExecute(input, output)
UpdatefromcliCommand->>JoomlaApp: getLanguage()
JoomlaApp-->>UpdatefromcliCommand: Language
UpdatefromcliCommand->>Language: load(lib_joomla, JPATH_ADMINISTRATOR)
UpdatefromcliCommand->>Language: load(com_installer, JPATH_ADMINISTRATOR, en-GB, false, true)
UpdatefromcliCommand->>Language: load(com_installer, JPATH_ADMINISTRATOR, null, true)
UpdatefromcliCommand->>JoomlaApp: bootComponent(com_installer)
JoomlaApp-->>UpdatefromcliCommand: InstallerComponent
UpdatefromcliCommand->>InstallerComponent: getMVCFactory()
InstallerComponent-->>UpdatefromcliCommand: MVCFactory
UpdatefromcliCommand->>InstallerComponent: createModel(Update)
InstallerComponent-->>UpdatefromcliCommand: UpdateModel
UpdatefromcliCommand->>UpdateModel: findUpdates()
UpdateModel-->>UpdatefromcliCommand: updates
UpdatefromcliCommand->>UpdatefromcliCommand: getExtensionInfo(updates)
UpdatefromcliCommand->>SymfonyConsole: render table with extensions
UpdatefromcliCommand-->>SymfonyConsole: return status code
SymfonyConsole-->>CliUser: output result
Updated class diagram for UpdatefromcliCommand language handlingclassDiagram
class UpdatefromcliCommand {
- application : Joomla_Application
+ doExecute(input : InputInterface, output : OutputInterface) int
- getExtensionInfo(update : mixed) array
}
class Joomla_Application {
+ getLanguage() Language
+ bootComponent(option : string) Component
}
class Language {
+ load(extension : string, basePath : string)
+ load(extension : string, basePath : string, language : string, reload : bool, default : bool)
}
class Component {
+ getMVCFactory() MVCFactory
+ createModel(name : string) Model
}
class MVCFactory {
+ createModel(name : string) Model
}
class UpdateModel {
+ findUpdates() array
}
class InputInterface
class OutputInterface
UpdatefromcliCommand --> Joomla_Application : uses
UpdatefromcliCommand --> Language : loads_strings_via
UpdatefromcliCommand --> UpdateModel : uses
Joomla_Application --> Language : provides
Joomla_Application --> Component : boots
Component --> MVCFactory : provides
MVCFactory --> UpdateModel : creates
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The new language-loading block mixes tabs and spaces for indentation; align it with the existing coding style in this file for consistency.
- The comment
// Load languages keyis a bit unclear—consider rephrasing it to something more descriptive like// Load core and installer language filesso future readers immediately understand the purpose.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new language-loading block mixes tabs and spaces for indentation; align it with the existing coding style in this file for consistency.
- The comment `// Load languages key` is a bit unclear—consider rephrasing it to something more descriptive like `// Load core and installer language files` so future readers immediately understand the purpose.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
see discussion here joomla/joomla-cms#47203 (comment)
Summary by Sourcery
Enhancements: