Issue #2843147 by Wim Leers, e0ipso, gabesullice, dagmar, xjm, effulgentsia, webchick, dww, Berdir, dawehner, colan, mgalalm, govind.maloo, das-peter, jludwig, ndobromirov, martin107, abhisekmazumdar, nuez, catch, amateescu, pwolanin, mallezie, borisson_, jibran, voleger, plach, GeduR, Grimreaper, apupiales, Sutharsan, RenatoG, michaellander, sergesemashko, dbt102, hampercm, dremy, rpayanm, chriscalip, tstoeckler, keopx, skyredwang, Spleshka, RajeevK, matthew.perry, kaysenlau, jazzdrive3, dsdeiz, ebeyrent, acbramley, deviantintegral, samuel.mortenson, DamienMcKenna, mohit_aghera, ibustos, dpolant, garphy: Add JSON:API to core as a stable module
2019-03-20 23:41:11 +00:00
< ? php
/**
* @ file
* Module install file .
*/
2019-10-10 06:33:02 +00:00
use Drupal\Core\Url ;
Issue #2843147 by Wim Leers, e0ipso, gabesullice, dagmar, xjm, effulgentsia, webchick, dww, Berdir, dawehner, colan, mgalalm, govind.maloo, das-peter, jludwig, ndobromirov, martin107, abhisekmazumdar, nuez, catch, amateescu, pwolanin, mallezie, borisson_, jibran, voleger, plach, GeduR, Grimreaper, apupiales, Sutharsan, RenatoG, michaellander, sergesemashko, dbt102, hampercm, dremy, rpayanm, chriscalip, tstoeckler, keopx, skyredwang, Spleshka, RajeevK, matthew.perry, kaysenlau, jazzdrive3, dsdeiz, ebeyrent, acbramley, deviantintegral, samuel.mortenson, DamienMcKenna, mohit_aghera, ibustos, dpolant, garphy: Add JSON:API to core as a stable module
2019-03-20 23:41:11 +00:00
/**
* Implements hook_install () .
*/
function jsonapi_install () {
$module_handler = \Drupal :: moduleHandler ();
$potential_conflicts = [
'content_translation' ,
'config_translation' ,
'language' ,
];
$should_warn = array_reduce ( $potential_conflicts , function ( $should_warn , $module_name ) use ( $module_handler ) {
return $should_warn ? : $module_handler -> moduleExists ( $module_name );
}, FALSE );
if ( $should_warn ) {
\Drupal :: messenger () -> addWarning ( t ( 'Some multilingual features currently do not work well with JSON:API. See the <a href=":jsonapi-docs">JSON:API multilingual support documentation</a> for more information on the current status of multilingual support.' , [
':jsonapi-docs' => 'https://www.drupal.org/docs/8/modules/jsonapi/translations' ,
]));
}
}
/**
* Implements hook_requirements () .
*/
function jsonapi_requirements ( $phase ) {
$requirements = [];
if ( $phase === 'runtime' ) {
$module_handler = \Drupal :: moduleHandler ();
$potential_conflicts = [
'content_translation' ,
'config_translation' ,
'language' ,
];
$should_warn = array_reduce ( $potential_conflicts , function ( $should_warn , $module_name ) use ( $module_handler ) {
return $should_warn ? : $module_handler -> moduleExists ( $module_name );
}, FALSE );
if ( $should_warn ) {
$requirements [ 'jsonapi_multilingual_support' ] = [
'title' => t ( 'JSON:API multilingual support' ),
'value' => t ( 'Limited' ),
'severity' => REQUIREMENT_INFO ,
'description' => t ( 'Some multilingual features currently do not work well with JSON:API. See the <a href=":jsonapi-docs">JSON:API multilingual support documentation</a> for more information on the current status of multilingual support.' , [
':jsonapi-docs' => 'https://www.drupal.org/docs/8/modules/jsonapi/translations' ,
]),
];
}
$requirements [ 'jsonapi_revision_support' ] = [
'title' => t ( 'JSON:API revision support' ),
'value' => t ( 'Limited' ),
'severity' => REQUIREMENT_INFO ,
'description' => t ( 'Revision support is currently read-only and only for the "Content" and "Media" entity types in JSON:API. See the <a href=":jsonapi-docs">JSON:API revision support documentation</a> for more information on the current status of revision support.' , [
':jsonapi-docs' => 'https://www.drupal.org/docs/8/modules/jsonapi/revisions' ,
]),
];
2019-10-10 06:33:02 +00:00
$requirements [ 'jsonapi_read_only_mode' ] = [
'title' => t ( 'JSON:API allowed operations' ),
'value' => t ( 'Read-only' ),
'severity' => REQUIREMENT_INFO ,
];
if ( ! \Drupal :: configFactory () -> get ( 'jsonapi.settings' ) -> get ( 'read_only' )) {
$requirements [ 'jsonapi_read_only_mode' ][ 'value' ] = t ( 'All (create, read, update, delete)' );
$requirements [ 'jsonapi_read_only_mode' ][ 'description' ] = t ( 'It is recommended to <a href=":configure-url">configure</a> JSON:API to only accept all operations if the site requires it. <a href=":docs">Learn more about securing your site with JSON:API.</a>' , [
':docs' => 'https://www.drupal.org/docs/8/modules/jsonapi/security-considerations' ,
':configure-url' => Url :: fromRoute ( 'jsonapi.settings' ) -> toString (),
]);
}
Issue #2843147 by Wim Leers, e0ipso, gabesullice, dagmar, xjm, effulgentsia, webchick, dww, Berdir, dawehner, colan, mgalalm, govind.maloo, das-peter, jludwig, ndobromirov, martin107, abhisekmazumdar, nuez, catch, amateescu, pwolanin, mallezie, borisson_, jibran, voleger, plach, GeduR, Grimreaper, apupiales, Sutharsan, RenatoG, michaellander, sergesemashko, dbt102, hampercm, dremy, rpayanm, chriscalip, tstoeckler, keopx, skyredwang, Spleshka, RajeevK, matthew.perry, kaysenlau, jazzdrive3, dsdeiz, ebeyrent, acbramley, deviantintegral, samuel.mortenson, DamienMcKenna, mohit_aghera, ibustos, dpolant, garphy: Add JSON:API to core as a stable module
2019-03-20 23:41:11 +00:00
}
return $requirements ;
}
/**
Issue #3087644 by jibran, Berdir, alexpott, longwave, Wim Leers, amateescu, catch, xjm, larowlan, dpi, quietone: Remove Drupal 8 updates up to and including 88**
2020-01-24 23:52:03 +00:00
* Implements hook_update_last_removed () .
Issue #2843147 by Wim Leers, e0ipso, gabesullice, dagmar, xjm, effulgentsia, webchick, dww, Berdir, dawehner, colan, mgalalm, govind.maloo, das-peter, jludwig, ndobromirov, martin107, abhisekmazumdar, nuez, catch, amateescu, pwolanin, mallezie, borisson_, jibran, voleger, plach, GeduR, Grimreaper, apupiales, Sutharsan, RenatoG, michaellander, sergesemashko, dbt102, hampercm, dremy, rpayanm, chriscalip, tstoeckler, keopx, skyredwang, Spleshka, RajeevK, matthew.perry, kaysenlau, jazzdrive3, dsdeiz, ebeyrent, acbramley, deviantintegral, samuel.mortenson, DamienMcKenna, mohit_aghera, ibustos, dpolant, garphy: Add JSON:API to core as a stable module
2019-03-20 23:41:11 +00:00
*/
Issue #3087644 by jibran, Berdir, alexpott, longwave, Wim Leers, amateescu, catch, xjm, larowlan, dpi, quietone: Remove Drupal 8 updates up to and including 88**
2020-01-24 23:52:03 +00:00
function jsonapi_update_last_removed () {
2022-08-11 12:02:30 +00:00
return 9401 ;
2021-12-30 11:16:28 +00:00
}