Skip to content

Commit

Permalink
chore(deprecation): all code deprecated before Elgg 1.9 has been removed
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
The following views, functions and methods have been removed completely.

Removed views:

 - canvas/layouts/*
 - categories
 - categories/view
 - embed/addcontentjs
 - groups/left_column
 - groups/right_column
 - invitefriends/formitems
 - notifications/subscriptions/groupsform

Removed functions:

 - count_unread_messages()
 - delete_entities()
 - delete_object_entity()
 - delete_user_entity()
 - elgg_validate_action_url()
 - extend_view()
 - get_entities()
 - get_entities_from_access_id()
 - get_entities_from_access_collection()
 - get_entities_from_annotations()
 - get_entities_from_metadata()
 - get_entities_from_metadata_multi()
 - get_entities_from_relationship()
 - get_filetype_cloud
 - get_library_files()
 - get_views()
 - is_ip_in_array()
 - list_entities()
 - list_entities_from_annotations()
 - list_group_search()
 - list_registered_entities()
 - list_user_search()
 - menu_item()
 - make_register_object()
 - search_for_group()
 - search_for_object()
 - search_for_site()
 - search_for_user()
 - search_list_objects_by_name()
 - search_list_groups_by_name()
 - search_list_users_by_name()
 - test_ip()

Removed methods:

 - ElggCache::set_variable()
 - ElggCache::get_variable()
 - ElggData::initialise_attributes()
 - ElggData::getObjectOwnerGUID()
 - ElggDiskFilestore::make_directory_root()
 - ElggDiskFilestore::make_file_matrix()
 - ElggDiskFilestore::user_file_matrix()
 - ElggDiskFilestore::mb_str_split()
 - ElggEntity::clearMetadata()
 - ElggEntity::clearRelationships()
 - ElggEntity::clearAnnotations()
 - ElggEntity::getOwner()
 - ElggEntity::setContainer()
 - ElggEntity::getContainer()
 - ElggEntity::getIcon()
 - ElggEntity::setIcon()
 - ElggExtender::getOwner()
 - ElggFileCache::create_file()
 - ElggSite::getCollections()
 - ElggUser::getCollections()
 - ElggUser::getOwner()

Also the following arguments have been dropped:

 - ElggSite::getMembers()
   - 2: $offset
 - elgg_view_entity_list()
   - 3: $offset
   - 4: $limit
   - 5: $full_view
   - 6: $list_type_toggle
   - 7: $pagination
  • Loading branch information
Juho Jaakkola committed Jun 25, 2015
1 parent 2247ed8 commit 852b264
Show file tree
Hide file tree
Showing 31 changed files with 126 additions and 6,481 deletions.
1 change: 0 additions & 1 deletion docs/design/loggable.rst
Expand Up @@ -10,7 +10,6 @@ Loggable defines several class methods that are used in saving to the default sy
- ``getType()`` Return the object type - ``getType()`` Return the object type
- ``getSubtype()`` Get the object subtype - ``getSubtype()`` Get the object subtype
- ``getObjectFromID($id)`` For a given ID, return the object associated with it - ``getObjectFromID($id)`` For a given ID, return the object associated with it
- ``getObjectOwnerGUID()`` Return the GUID of the owner of this object


Database details Database details
---------------- ----------------
Expand Down
98 changes: 86 additions & 12 deletions docs/guides/upgrading.rst
Expand Up @@ -28,27 +28,35 @@ you will get an error message:


.. code:: shell .. code:: shell
[InvalidArgumentException] [InvalidArgumentException]
Package fxp/composer-asset-plugin not found Package fxp/composer-asset-plugin not found
All deprecated views and view arguments have been removed List of deprecated views and view arguments that have been removed
--------------------------------------------------------- ------------------------------------------------------------------


We dropped support for and/or removed the following views: We dropped support for and/or removed the following views:


* canvas/layouts/*
* categories
* categories/view
* core/settings/tools * core/settings/tools
* embed/addcontentjs
* footer/analytics (Use page/elements/foot instead) * footer/analytics (Use page/elements/foot instead)
* groups/left_column
* groups/right_column
* groups/search/finishblurb * groups/search/finishblurb
* groups/search/startblurb * groups/search/startblurb
* input/calendar (Use input/date instead) * input/calendar (Use input/date instead)
* input/datepicker (Use input/date instead) * input/datepicker (Use input/date instead)
* input/pulldown (Use input/select instead) * input/pulldown (Use input/select instead)
* invitefriends/formitems
* js/initialise_elgg (Use AMD and ``elgg_require_js`` instead of extending JS views) * js/initialise_elgg (Use AMD and ``elgg_require_js`` instead of extending JS views)
* members/nav * members/nav
* metatags (Use the 'head', 'page' plugin hook instead) * metatags (Use the 'head', 'page' plugin hook instead)
* navigation/topbar_tools * navigation/topbar_tools
* navigation/viewtype * navigation/viewtype
* notifications/subscriptions/groupsform
* output/calendar (Use output/date instead) * output/calendar (Use output/date instead)
* output/confirmlink (Use output/url instead) * output/confirmlink (Use output/url instead)
* page_elements/contentwrapper * page_elements/contentwrapper
Expand All @@ -60,15 +68,16 @@ We dropped support for and/or removed the following views:
* user/search/startblurb * user/search/startblurb
* usersettings/{plugin}/edit (Use plugins/{plugin}/usersettings instead) * usersettings/{plugin}/edit (Use plugins/{plugin}/usersettings instead)
* widgets/{handler}/view (Use widgets/{handler}/content instead) * widgets/{handler}/view (Use widgets/{handler}/content instead)

We also dropped the following arguments to views: We also dropped the following arguments to views:


* "value" in output/iframe (Use "src" instead) * "value" in output/iframe (Use "src" instead)
* "area2" and "area3" in page/elements/sidebar (Use "sidebar" or view extension instead) * "area2" and "area3" in page/elements/sidebar (Use "sidebar" or view extension instead)
* "js" in icon views (e.g. icon/user/default) * "js" in icon views (e.g. icon/user/default)
* "options" to input/radio and input/checkboxes which aren't key-value pairs * "options" to input/radio and input/checkboxes which aren't key-value pairs
will no longer be acceptable. will no longer be acceptable.



All scripts moved to bottom of page All scripts moved to bottom of page
----------------------------------- -----------------------------------


Expand Down Expand Up @@ -251,14 +260,82 @@ Also note that plugins should not be accessing the global ``$CONFIG`` variable e
Removed Functions Removed Functions
----------------- -----------------


- ``count_unread_messages()``
- ``delete_entities()``
- ``delete_object_entity()``
- ``delete_user_entity()``
- ``elgg_get_view_location()`` - ``elgg_get_view_location()``
- ``elgg_validate_action_url()``
- ``execute_delayed_query()`` - ``execute_delayed_query()``
- ``extend_view()``
- ``get_db_error()`` - ``get_db_error()``
- ``get_db_link()`` - ``get_db_link()``
- ``get_entities()``
- ``get_entities_from_access_id()``
- ``get_entities_from_access_collection()``
- ``get_entities_from_annotations()``
- ``get_entities_from_metadata()``
- ``get_entities_from_metadata_multi()``
- ``get_entities_from_relationship()``
- ``get_filetype_cloud()``
- ``get_library_files()``
- ``get_views()``
- ``is_ip_in_array()``
- ``list_entities()``
- ``list_entities_from_annotations()``
- ``list_group_search()``
- ``list_registered_entities()``
- ``list_user_search()``
- ``load_plugins()`` - ``load_plugins()``
- ``menu_item()``
- ``make_register_object()``
- ``mysql_*()``: Elgg :ref:`no longer uses ext/mysql<migrated-to-pdo>` - ``mysql_*()``: Elgg :ref:`no longer uses ext/mysql<migrated-to-pdo>`
- ``remove_blacklist()`` - ``remove_blacklist()``
- ``search_for_group()``
- ``search_for_object()``
- ``search_for_site()``
- ``search_for_user()``
- ``search_list_objects_by_name()``
- ``search_list_groups_by_name()``
- ``search_list_users_by_name()``
- ``set_template_handler()`` - ``set_template_handler()``
- ``test_ip()``

Removed methods
---------------

- ``ElggCache::set_variable()``
- ``ElggCache::get_variable()``
- ``ElggData::initialise_attributes()``
- ``ElggData::getObjectOwnerGUID()``
- ``ElggDiskFilestore::make_directory_root()``
- ``ElggDiskFilestore::make_file_matrix()``
- ``ElggDiskFilestore::user_file_matrix()``
- ``ElggDiskFilestore::mb_str_split()``
- ``ElggEntity::clearMetadata()``
- ``ElggEntity::clearRelationships()``
- ``ElggEntity::clearAnnotations()``
- ``ElggEntity::getOwner()``
- ``ElggEntity::setContainer()``
- ``ElggEntity::getContainer()``
- ``ElggEntity::getIcon()``
- ``ElggEntity::setIcon()``
- ``ElggExtender::getOwner()``
- ``ElggFileCache::create_file()``
- ``ElggSite::getCollections()``
- ``ElggUser::getCollections()``
- ``ElggUser::getOwner()``

The following arguments have also been dropped:

- ``ElggSite::getMembers()``
- 2: ``$offset``
- ``elgg_view_entity_list()``
- 3: ``$offset``
- 4: ``$limit``
- 5: ``$full_view``
- 6: ``$list_type_toggle``
- 7: ``$pagination``


Removed Plugin Hooks Removed Plugin Hooks
-------------------- --------------------
Expand Down Expand Up @@ -761,7 +838,7 @@ Use standardized page handlers and scripts
The ``object/:subtype`` view The ``object/:subtype`` view
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Make sure there are views for ``$vars['full_view'] == true`` and ``$vars['full_view'] == false``. ``$vars['full_view']`` replaced ``$vars['full]``. * Make sure there are views for ``$vars['full_view'] == true`` and ``$vars['full_view'] == false``. ``$vars['full_view']`` replaced ``$vars['full]``.
* Check for the object in ``$vars['entity']``. Use ``elgg_instance_of()`` to make sure it's the type of entity you want. * Check for the object in ``$vars['entity']``. Use ``elgg_instance_of()`` to make sure it's the type of entity you want.
* Return ``true`` to short circuit the view if the entity is missing or wrong. * Return ``true`` to short circuit the view if the entity is missing or wrong.
* Use ``elgg_view(‘object/elements/summary’, array(‘entity’ => $entity));`` and ``elgg_view_menu(‘entity’, array(‘entity’ => $entity));`` to help format. You should use very little markup in these views. * Use ``elgg_view(‘object/elements/summary’, array(‘entity’ => $entity));`` and ``elgg_view_menu(‘entity’, array(‘entity’ => $entity));`` to help format. You should use very little markup in these views.


Expand All @@ -770,7 +847,7 @@ Update action structure
~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
* Namespace action files and action names (example: ``mod/blog/actions/blog/save.php`` => ``action/blog/save``) * Namespace action files and action names (example: ``mod/blog/actions/blog/save.php`` => ``action/blog/save``)
* Use the following action URLs: * Use the following action URLs:

* Add: ``action/:plugin/save`` * Add: ``action/:plugin/save``
* Edit: ``action/:plugin/save`` * Edit: ``action/:plugin/save``
* Delete: ``action/:plugin/delete`` * Delete: ``action/:plugin/delete``
Expand All @@ -781,11 +858,8 @@ Update action structure
Update deprecated functions Update deprecated functions
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Functions deprecated in 1.7 will produce visible errors in 1.8. * Functions deprecated in 1.7 will produce visible errors in 1.8.

* See ``/engine/lib/deprecated-1.7.php`` for the full list.

* You can also update functions deprecated in 1.8. * You can also update functions deprecated in 1.8.

* Many registration functions simply added an ``elgg_`` prefix for consistency, and should be easy to update. * Many registration functions simply added an ``elgg_`` prefix for consistency, and should be easy to update.
* See ``/engine/lib/deprecated-1.8.php`` for the full list. * See ``/engine/lib/deprecated-1.8.php`` for the full list.
* You can set the debug level to “warning” to get visual reminders of deprecated functions. * You can set the debug level to “warning” to get visual reminders of deprecated functions.
Expand Down
2 changes: 0 additions & 2 deletions engine/classes/Elgg/Application.php
Expand Up @@ -180,8 +180,6 @@ public function loadCore() {
'widgets.php', 'widgets.php',


// backward compatibility // backward compatibility
'deprecated-1.7.php',
'deprecated-1.8.php',
'deprecated-1.9.php', 'deprecated-1.9.php',
'deprecated-1.10.php', 'deprecated-1.10.php',
'deprecated-1.11.php', 'deprecated-1.11.php',
Expand Down
33 changes: 0 additions & 33 deletions engine/classes/ElggCache.php
Expand Up @@ -21,23 +21,6 @@ public function __construct() {
$this->variables = array(); $this->variables = array();
} }


// @codingStandardsIgnoreStart
/**
* Set a cache variable.
*
* @param string $variable Name
* @param string $value Value
*
* @return void
*
* @deprecated 1.8 Use \ElggCache:setVariable()
*/
public function set_variable($variable, $value) {
elgg_deprecated_notice('\ElggCache::set_variable() is deprecated by \ElggCache::setVariable()', 1.8);
$this->setVariable($variable, $value);
}
// @codingStandardsIgnoreEnd

/** /**
* Set a cache variable. * Set a cache variable.
* *
Expand All @@ -54,22 +37,6 @@ public function setVariable($variable, $value) {
$this->variables[$variable] = $value; $this->variables[$variable] = $value;
} }


// @codingStandardsIgnoreStart
/**
* Get variables for this cache.
*
* @param string $variable Name
*
* @return mixed The value or null;
*
* @deprecated 1.8 Use \ElggCache::getVariable()
*/
public function get_variable($variable) {
elgg_deprecated_notice('\ElggCache::get_variable() is deprecated by \ElggCache::getVariable()', 1.8);
return $this->getVariable($variable);
}
// @codingStandardsIgnoreEnd

/** /**
* Get variables for this cache. * Get variables for this cache.
* *
Expand Down
32 changes: 0 additions & 32 deletions engine/classes/ElggData.php
Expand Up @@ -22,27 +22,6 @@ abstract class ElggData implements
*/ */
protected $attributes = array(); protected $attributes = array();


// @codingStandardsIgnoreStart
/**
* Initialise the attributes array.
*
* This is vital to distinguish between metadata and base parameters.
*
* @param bool $pre18_api Compatibility for subclassing in 1.7 -> 1.8 change.
* Passing true (default) emits a deprecation notice.
* Passing false returns false. Core constructors always pass false.
* Does nothing either way since attributes are initialized by the time
* this is called.
* @return void
* @deprecated 1.8 Use initializeAttributes()
*/
protected function initialise_attributes($pre18_api = true) {
if ($pre18_api) {
elgg_deprecated_notice('initialise_attributes() is deprecated by initializeAttributes()', 1.8);
}
}
// @codingStandardsIgnoreEnd

/** /**
* Initialize the attributes array. * Initialize the attributes array.
* *
Expand Down Expand Up @@ -154,17 +133,6 @@ public function getClassName() {
return get_class($this); return get_class($this);
} }


/**
* Return the GUID of the owner of this object.
*
* @return int
* @deprecated 1.8 Use getOwnerGUID() instead
*/
public function getObjectOwnerGUID() {
elgg_deprecated_notice("getObjectOwnerGUID() was deprecated. Use getOwnerGUID().", 1.8);
return $this->owner_guid;
}

/* /*
* ITERATOR INTERFACE * ITERATOR INTERFACE
*/ */
Expand Down
86 changes: 0 additions & 86 deletions engine/classes/ElggDiskFilestore.php
Expand Up @@ -275,23 +275,6 @@ public function getSize($prefix, $container_guid) {
} }
} }


// @codingStandardsIgnoreStart
/**
* Create a directory $dirroot
*
* @param string $dirroot The full path of the directory to create
*
* @throws IOException
* @return true
* @deprecated 1.8 Use \ElggDiskFilestore::makeDirectoryRoot()
*/
protected function make_directory_root($dirroot) {
elgg_deprecated_notice('\ElggDiskFilestore::make_directory_root() is deprecated by ::makeDirectoryRoot()', 1.8);

return $this->makeDirectoryRoot($dirroot);
}
// @codingStandardsIgnoreEnd

/** /**
* Create a directory $dirroot * Create a directory $dirroot
* *
Expand Down Expand Up @@ -342,75 +325,6 @@ public function setParameters(array $parameters) {
* Deprecated methods * Deprecated methods
*/ */


// @codingStandardsIgnoreStart
/**
* Construct a file path matrix for an entity.
*
* @param int $identifier The guid of the entity to store the data under.
*
* @return string The path where the entity's data will be stored.
* @deprecated 1.8 Use \Elgg\EntityDirLocator
*/
protected function make_file_matrix($identifier) {
elgg_deprecated_notice('\ElggDiskFilestore::make_file_matrix() is deprecated by \Elgg\EntityDirLocator', 1.8);

return $this->makeFileMatrix($identifier);
}
// @codingStandardsIgnoreEnd

// @codingStandardsIgnoreStart
/**
* Construct a filename matrix.
*
* Generates a matrix using the entity's creation time and
* unique guid.
*
* @param int $guid The entity to contrust a matrix for
*
* @deprecated 1.8 Use \ElggDiskFileStore::makeFileMatrix()
* @return string The
*/
protected function user_file_matrix($guid) {
elgg_deprecated_notice('\ElggDiskFilestore::user_file_matrix() is deprecated by \Elgg\EntityDirLocator', 1.8);

return $this->makeFileMatrix($guid);
}
// @codingStandardsIgnoreEnd

// @codingStandardsIgnoreStart
/**
* Multibyte string tokeniser.
*
* Splits a string into an array. Will fail safely if mbstring is
* not installed.
*
* @param string $string String
* @param string $charset The charset, defaults to UTF8
*
* @return array
* @deprecated 1.8 Files are stored by date and guid; no need for this.
*/
private function mb_str_split($string, $charset = 'UTF8') {
elgg_deprecated_notice('\ElggDiskFilestore::mb_str_split() is deprecated.', 1.8);

if (is_callable('mb_substr')) {
$length = mb_strlen($string);
$array = array();

while ($length) {
$array[] = mb_substr($string, 0, 1, $charset);
$string = mb_substr($string, 1, $length, $charset);

$length = mb_strlen($string);
}

return $array;
} else {
return str_split($string);
}
}
// @codingStandardsIgnoreEnd

/** /**
* Construct a file path matrix for an entity. * Construct a file path matrix for an entity.
* *
Expand Down

0 comments on commit 852b264

Please sign in to comment.