Topic solved
This topic is marked as solved and as such require no attention unless you want to bump this issue.

Missing install integrate_modification_types

Started by wintstar, December 12, 2015, 02:32:31 PM

Previous topic - Next topic

wintstar

install.php

find
Code (php) Select
    $hooks[] = array(
        'hook' => 'integrate_package_upload',
        'function' => 'shd_package_upload',
        'file' => '$sourcedir/sd_source/Subs-SimpleDeskPackages.php',
        'perm' => true,
    );

add after
Code (php) Select
    $hooks[] = array(
        'hook' => 'integrate_modification_types',
        'function' => 'shd_modification_types',
        'file' => '$sourcedir/sd_source/Subs-SimpleDeskPackages.php',
        'perm' => true,
    );


sd_language/SimpleDeskAdmin.english.php

find
Code (php) Select
$txt['shd_search_rebuilt'] = 'The search index has been rebuilt.';
//@}

add after
Code (php) Select


//! Package Plugin
//@{
$txt['sdplugin_package'] = 'SDPlugin packages';
//@}

wintstar

#1
?There seems to be a bug to with SMF call_integration_hook ('integrate_modification_types');?  There the modification type is not recognized, please look at image pluginsystem-3.PNG

Subs-SimpleDeskPackages.php
Code (php) Select
/**
*    Sets up the browse section for plugins.
*
*    @since 2.1
*/
function shd_modification_types()
{
    global $context, $txt;

    $context['modification_types'][] = 'sdplugin';
}


sources/Packes.php
Code (php) Select
    $context['modification_types'] = array('modification', 'avatar', 'language', 'unknown');

only when I change in Subs-SimpleDeskPackages.php this to
Code (php) Select
    $context['modification_types'] = array('modification', 'avatar', 'language', 'unknown', 'sdplugin');
is he modification type is detected. For this purpose, I have to remove the variable $packes in Hook integrate_packages_sort_id
Code (php) Select
function shd_packages_sort_id(&$sort_id, &$packages)
{
    global $context, $packages;
But then missing the information that this plugin is installed and when it was installed, please look at image pluginsystem-4.PNG

wintstar

#2
One step I continued
when in Packes.php change from
Code (php) Select
function PackageBrowse()
{
    global $txt, $scripturl, $context, $forum_version, $sourcedir, $smcFunc;

    $context['page_title'] .= ' - ' . $txt['browse_packages'];

    $context['forum_version'] = $forum_version;
    $context['modification_types'] = array('modification', 'avatar', 'language', 'unknown');

    call_integration_hook('integrate_modification_types');


to
Code (php) Select
function PackageBrowse()
{
    global $txt, $scripturl, $context, $forum_version, $sourcedir, $smcFunc;

    $context['page_title'] .= ' - ' . $txt['browse_packages'];
    $context['forum_version'] = $forum_version;

    $type = array('modification', 'avatar', 'language', 'unknown');

    $context['modification_types'] = $type;

    call_integration_hook('integrate_modification_types');


works the hook "integrate_modification_types" and  any modification type can be added. Then only missing the information, if and when installed. If the variable "$packes" to function "shd_packages_sort_id" added, the modification type is no longer detected. But it appears the information if and when installed.  ???




SleePy

I did a commit to fix the hooks not installing/uninstalling correctly.  But I can't reproduce your issue.  It works fine for me.
Jeremy D — Spare-Developer

wintstar

#4
With the change in Packes.php is not resolved. There is still no information when and if the plugin is installed. Look at the first image.

If the variable $packages is removed  then the information is displayed.  But the modification type is not recognized. Look at the last image.
Packes.php
Code (php) Select
        call_integration_hook('integrate_packages_sort_id', array(&$sort_id));
Subs-SimpleDeskPackages.php
Code (php) Select
function shd_packages_sort_id(&$sort_id)
{
    global $context;

    $sort_id['sdplugin'] = 1;
    $context['available_sdplugin'] = array();
}


The plugin is installed. But can not be uninstalled, because the wrong button is displayed. Look at the first image.

SleePy

Jeremy D — Spare-Developer

wintstar