Problem/Motivation
Locale module makes use of update_process_info_list() to get project information. Without update module interface translations can not be downloaded or updated because the is not information about the project available. This will result in (partly) untranslated sites and thus bad user experience when for example the 'Check for updates automatically' is disabled during installation.
Proposed resolution
The proposed solution is to move the functions responsible for parsing the project information out of Update module into a file includes/project.inc
When this move is completed, the project data handling and caching can be improved in #1832946: Runtime translation download fallback works different from installer translation download fallback.
Remaining tasks
Improve the project data handling in #1832946: Runtime translation download fallback works different from installer translation download fallback
User interface changes
none
API changes
t.b.d.
Related Issues
none
Comment | File | Size | Author |
---|---|---|---|
#13 | project-2030775-12.patch | 25.56 KB | webflo |
#13 | project-2030775-11-12.interdiff.txt | 1.86 KB | webflo |
#11 | project-2030775-11.patch | 25.56 KB | webflo |
#11 | project-2030775-9-11.interdiff.txt | 1.42 KB | webflo |
#9 | project-2030775-9.patch | 25.41 KB | webflo |
Comments
Comment #1
Sutharsan CreditAttribution: Sutharsan commentedThis patch only moves code around, changes related documentation and changes function names. In https://drupal.org/node/1832946#comment-6922286 dww asked not to use the 'project' namespace as this will conflict with Project module. The patch uses 'drupal_project_' in line with existing functions in core/include/*.inc.
Following function names are changed:
update_process_info_list()
todrupal_project_process_info_list()
update_get_project_name()
todrupal_project_get_project_name()
update_process_project_info()
todrupal_project_process_project_info()
Comment #2
Sutharsan CreditAttribution: Sutharsan commentedIgnore #1 patch, I forgot rebase before making the patch. This is what is was meant to be.
Comment #3
Sutharsan CreditAttribution: Sutharsan commentedI missed one function:
update_filter_project_info()
todrupal_project_filter_project_info
Comment #4
Sutharsan CreditAttribution: Sutharsan commentedSome more coming up, but need to sleep first.
Comment #5
Sutharsan CreditAttribution: Sutharsan commentedOk, this is the patch. I've moved one function back.
The patch now moves
drupal_project_process_info_list()
and the functions its calls into a new project.inc file. These are the functions that collects and structures project information which will be used by Locale and Update module for their project processing.update_process_info_list()
changed todrupal_project_process_info_list()
update_get_project_name()
changed todrupal_project_get_project_name()
update_filter_project_info()
changed todrupal_project_filter_project_info()
Comment #6
webflo CreditAttribution: webflo commentedFound one wrong @see comment and fixed it.
Comment #7
kfritscheCode seems reasonable. Nothing to complain from my side.
Did also a manual test:
Freshly install of Drupal
Downloaded config_translation
Added to the config_translation.info.yml file:
Did a update/check and no errors occurred.
Detected that there could be a newer version because of missing publication date. Also added a datestamp and everything worked fine.
So RTCB now, when green.
Comment #8
Gábor HojtsyAll right, let's refactor this to a small tiny utility class. After talking to @alexpott.
Comment #9
webflo CreditAttribution: webflo commentedWe move this code to \Drupal\Core\Utility\ProjectInfo
Comment #10
Gábor HojtsyContains and \Drupal....
Nananananna! Do a use and then only ProjectInfo here.
Comment #11
webflo CreditAttribution: webflo commentedChanges the docs and added a use statement.
Comment #12
Gábor HojtsyNeeds slash.
Should not have slash.
Comment #13
webflo CreditAttribution: webflo commentedApplied coding standards.
Comment #14
Gábor HojtsyLooks all great now, yay!
Comment #15
alexpottThis just pushes code around... we can now clean up up the passing the array by reference, create an interface, and define the scope of the methods in a followup.
Committed c56cb20 and pushed to 8.x. Thanks!
Comment #17
Gábor HojtsyYay!