error after uninstall mod with css file minified

Started by Pipke, January 28, 2020, 05:17:13 PM

Previous topic - Next topic

Pipke

Does the error come from my wrong coding setup of the xml file or is this a bug in SMF 2.1 RC2 latest version of today.

loadCSSFile('AvatarsDisplayIntegration.css', array('force_current' => false, 'validate' => true));


QuoteError
Type of error: General
Error message:
The file "AvatarsDisplayIntegration.css" could not be located on the current or the default theme and, therefore, it was not included in the minified file.
URL of page causing the error: http://localhost/smf2/index.php?action=admin;area=packages;sa=uninstall2;package=1580217019.zip;pid=2
Backtrace information
#0: custMinify()
Called from D:\xampp\htdocs\smf2\Sources\Subs.php on line 4185
#1: template_css()
Called from D:\xampp\htdocs\smf2\Themes\default\index.template.php on line 117
#2: template_html_above()
Called from D:\xampp\htdocs\smf2\Sources\Load.php on line 2529
#3: loadSubTemplate()
Called from D:\xampp\htdocs\smf2\Sources\Subs.php on line 3887
#4: template_header()
Called from D:\xampp\htdocs\smf2\Sources\Subs.php on line 3471
#5: obExit()
Called from D:\xampp\htdocs\smf2\index.php on line 171

here the install and uninstall part of the package-info.xml file

<install for="2.1 - 2.1.99, 2.1 RC2, 2.1 RC3">
<readme parsebbc="true">readme.txt</readme>
<code>AvatarsDisplayIntegration.hooks.php</code>
<require-file name="AvatarsDisplayIntegration.php" destination="$sourcedir" />
        <require-file name="AvatarsDisplayIntegration.english.php" destination="$languagedir" />
<require-file name="AvatarsDisplayIntegration.css" destination="$themedir/css" />
<redirect url="?action=admin;area=manageattachments;sa=avatars">redirect.txt</redirect>
</install>
<uninstall for="2.1 - 2.1.99, 2.1 RC2, 2.1 RC3">
<code>AvatarsDisplayIntegration.hooks.php</code>
<remove-file name="$sourcedir/AvatarsDisplayIntegration.php" />
        <remove-file name="$languagedir/AvatarsDisplayIntegration.english.php" />
<remove-file name="$themedir/css/AvatarsDisplayIntegration.css" />
<redirect url="$scripturl?action=admin;area=packages" timeout="5000"></redirect>
</uninstall>


How to fix it if i did something wrong.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Herman's Mixen

Looks like a windows problem, check that your folder and underneath folders aren't Read Only ;)
Met vriendelijke groet, The Burglar!

 House Mixes | Mixcloud | Any Intelligent fool can make things bigger, more complex, and more violent.
It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Albert Einstein

Former Godfather of our dutch community ;)

Pipke

Quote from: Herman's Mixen on January 28, 2020, 05:38:47 PM
Looks like a windows problem, check that your folder and underneath folders aren't Read Only ;)

Thats not the issue problem, the issue is after uninstalling it is been removed right, but somehow in smf coding it still calls the css file maybe from cache or db idk.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Herman's Mixen

What does repair_settings remove / disable hooks ?

and yes it could be an caching thing
Met vriendelijke groet, The Burglar!

 House Mixes | Mixcloud | Any Intelligent fool can make things bigger, more complex, and more violent.
It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Albert Einstein

Former Godfather of our dutch community ;)

Illori

if you do remove hooks, then you also need to upload clean files and reinstall all your mods.

Pipke

Think you all dont understand where i'm talking about, i made a mod, when uninstalling it, smf throws up an error (one call) after uninstall of the mod about the css minified file, wich has been used inside mod, and now dont exists anymore after uninstall(see my first post), my question: is it wrong in my xml file or is this wrong on smf files.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Suki

It is a race condition and at this point I'm not too sure on how to tackle it properly on a generic level for hooks, the issue happens because $context['css_files'] still contains your css info.

Try unsetting your file from $context['css_files'] when uninstalling to see if that helps.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Pipke

Quote from: Suki on January 29, 2020, 12:13:17 PM
It is a race condition and at this point I'm not too sure on how to tackle it properly on a generic level for hooks, the issue happens because $context['css_files'] still contains your css info.

Try unsetting your file from $context['css_files'] when uninstalling to see if that helps.

Thx Suki for pointing out where to look for. This (workaround)code in the AvatarsDisplayIntegration.hooks.php file fixed the error.


if (!empty($context['uninstalling']))
{
// leave it out at this point, so it will not be included in the minified file after uninstall.
unset($context['css_files']['AvatarsDisplayIntegration']);

....
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Pipke

i just found out that for RC3 and RC4 smf changes the array key name after array at $context['uninstalling'], so i had to fix it for now to:


// Leave it out at this point, so it will not be included in the minified file after uninstall.
unset($context['css_files']['AvatarsDisplayIntegration_css']);


just to point out that in the current RC releases this is not fixed yet.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Pipke

typo fix for @ above post
Quotechanges the array key name after array at $context['uninstalling']

must be
changes the array key name in array at $context['css_files']
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

shawnb61

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

shawnb61

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Advertisement: