Skip to content
Snippets Groups Projects

ISTWCMS-7275: Rename "publication" to "reference" in custom block.

Open Igor Biki requested to merge feature/ISTWCMS-7275-ibiki-publications_rename into 1.1.x
1 file
+ 5
9
Compare changes
  • Side-by-side
  • Inline
@@ -55,7 +55,7 @@ function uw_custom_blocks_post_update_references_block_titles_updates_12(&$sandb
* The batch context array, which is updated with initial counts and a status
* message for the batch process.
*/
function _references_block_titles_updates_batch_start($count, &$context): void {
function _references_block_titles_updates_batch_start($count, array &$context): void {
$context['results']['nodes_count'] = $count;
$context['results']['nodes_processed'] = 0;
$context['results']['nodes_updated'] = 0;
@@ -77,12 +77,8 @@ function _references_block_titles_updates_batch_start($count, &$context): void {
* @param array $context
* A reference to the batch context array that tracks progress and statistics,
* including the number of nodes and revisions processed and updated.
*
* @return void
* This function does not return a value. It modifies the $context array
* directly and updates the node and its revisions in-place.
*/
function _references_block_titles_updates_batch_update($nid, &$context): void {
function _references_block_titles_updates_batch_update($nid, array &$context): void {
$node = \Drupal::entityTypeManager()->getStorage('node')->load($nid);
if ($node) {
@@ -162,7 +158,7 @@ function _references_block_titles_updates_batch_update($nid, &$context): void {
* The batch context array, which is updated with a status message
* indicating the processing of temporary storage.
*/
function _references_block_titles_updates_batch_temp_storage(&$context) {
function _references_block_titles_updates_batch_temp_storage(array &$context) {
// Make sure to load temp storage, and loop over sections there.
$context['message'] = t('Processing temporary storage.');
}
@@ -174,7 +170,7 @@ function _references_block_titles_updates_batch_temp_storage(&$context) {
* The batch context array, which gets updated with status messages
* about nodes and revisions processed during the batch operation.
*/
function _references_block_titles_updates_batch_end(&$context) {
function _references_block_titles_updates_batch_end(array &$context) {
$context['message'] = t('Updated @nodes_updated out of @nodes_processed (total @total) nodes.', [
'@nodes_updated' => $context['results']['nodes_updated'],
'@nodes_processed' => $context['results']['nodes_processed'],
@@ -199,6 +195,6 @@ function _references_block_titles_updates_batch_end(&$context) {
* @return string
* Translated message indicating the completion of the batch process.
*/
function _references_block_titles_updates_batch_finished($success, $results, $operations) {
function _references_block_titles_updates_batch_finished($success, array $results, array $operations) {
return t('Finished.');
}
Loading