File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
ProcessMaker/ImportExport/Exporters Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -44,10 +44,22 @@ public function import(): bool
4444
4545 $ ref = $ this ->getReference (DependentType::MEDIA );
4646 if ($ ref && isset ($ ref ['base64 ' ])) {
47- $ this ->model ->model ->addMediaFromBase64 ($ ref ['base64 ' ])
47+ $ newMedia = $ this ->model ->model ->addMediaFromBase64 ($ ref ['base64 ' ])
4848 ->usingFileName ($ this ->model ->file_name )
4949 ->withCustomProperties ($ this ->model ->custom_properties )
5050 ->toMediaCollection ($ this ->model ->collection_name );
51+
52+ if (hasPackage ('package-ai ' )) {
53+ $ updaterClass = 'ProcessMaker \\Package \\PackageAi \\Services \\FlowGenieMediaConfigUpdater ' ;
54+ if (class_exists ($ updaterClass )) {
55+ $ updaterClass ::updateForMediaImport (
56+ (string ) $ this ->model ->model_type ,
57+ (int ) $ this ->model ->model_id ,
58+ (int ) $ this ->model ->id ,
59+ (int ) $ newMedia ->id
60+ );
61+ }
62+ }
5163 }
5264
5365 // We should delete the model, because the Spatie library recreates it.
You can’t perform that action at this time.
0 commit comments