Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Hide Lua and R Script Executors
  • Loading branch information
nolanpro committed Jan 14, 2025
commit 83092ea4b79e0b43ea317451820b0a573100f388
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,9 @@ public function availableLanguages()
{
$languages = [];
foreach (Script::scriptFormats() as $key => $config) {
if (in_array($key, Script::deprecatedLanguages)) {
continue;
}
if (!array_key_exists('system', $config) || (array_key_exists('system', $config) && !$config['system'])) {
$languages[] = [
'value' => $key,
Expand Down
2 changes: 2 additions & 0 deletions ProcessMaker/Models/Script.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ class Script extends ProcessMakerModel implements ScriptInterface

const categoryClass = ScriptCategory::class;

const deprecatedLanguages = ['lua', 'r'];

protected $connection = 'processmaker';

protected $guarded = [
Expand Down
9 changes: 8 additions & 1 deletion ProcessMaker/Models/ScriptExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ class ScriptExecutor extends ProcessMakerModel
'title', 'description', 'language', 'config', 'is_system',
];

// Lua and R are deprecated. This scope can be removed
// when they are removed permanently.
public function scopeActive($query)
{
return $query->whereNotIn('language', Script::deprecatedLanguages);
}

public static function install($params)
{
$language = $params['language'];
Expand Down Expand Up @@ -153,7 +160,7 @@ public static function list($language = null, $forEditMode = false)
{
$list = [];
$executors =
self::where('is_system', false)->orderBy('language', 'asc')
self::active()->where('is_system', false)->orderBy('language', 'asc')
->orderBy('created_at', 'asc');

if ($language) {
Expand Down