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

Author Topic: Missing install integrate_modification_types  (Read 3146 times)

Offline wintstar

  • Newbie
  • *
  • Posts: 33
  • Carpe diem!
    • View Profile
    • Scaricare
Missing install integrate_modification_types
« on: December 12, 2015, 02:32:31 pm »
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';
//@}
« Last Edit: December 12, 2015, 02:34:30 pm by wintstar »

Offline wintstar

  • Newbie
  • *
  • Posts: 33
  • Carpe diem!
    • View Profile
    • Scaricare
Re: Missing install integrate_modification_types
« Reply #1 on: December 13, 2015, 06:47:18 am »
?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
« Last Edit: December 13, 2015, 07:07:45 am by wintstar »

Offline wintstar

  • Newbie
  • *
  • Posts: 33
  • Carpe diem!
    • View Profile
    • Scaricare
Re: Missing install integrate_modification_types
« Reply #2 on: December 13, 2015, 08:26:47 am »
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.  ???



« Last Edit: December 13, 2015, 08:29:17 am by wintstar »

Offline SleePy

  • Site Manager
  • Developer
  • *
  • Posts: 764
    • View Profile
    • SleePyCode
Re: Missing install integrate_modification_types
« Reply #3 on: December 14, 2015, 11:25:34 pm »
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

Offline wintstar

  • Newbie
  • *
  • Posts: 33
  • Carpe diem!
    • View Profile
    • Scaricare
Re: Missing install integrate_modification_types
« Reply #4 on: December 15, 2015, 12:35:42 am »
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.
« Last Edit: December 15, 2015, 04:27:51 am by wintstar »

Offline SleePy

  • Site Manager
  • Developer
  • *
  • Posts: 764
    • View Profile
    • SleePyCode
Re: Missing install integrate_modification_types
« Reply #5 on: December 24, 2015, 02:51:04 pm »
This is a SMF bug: https://github.com/SimpleMachines/SMF2.1/pull/3216

Once that is fixed this will work properly.
Jeremy D — Spare-Developer

Offline wintstar

  • Newbie
  • *
  • Posts: 33
  • Carpe diem!
    • View Profile
    • Scaricare
Re: Missing install integrate_modification_types
« Reply #6 on: December 24, 2015, 10:49:26 pm »
Bug fixed  :)

 

anything