Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 66 additions & 54 deletions docs/development/add-on-update-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

# Add-on Update File

[TOC]

## Overview

The `upd.[addon_name].php` file (commonly just called the `upd` file) is critical to ExpressionEngine knowing what to do with your add-on. Here we tell ExpressionEngine what actions to register, core hooks we want to use, database tables to update, and much more. We need to tell ExpressionEngine what to do when we install an add-on, update an add-on, and uninstall and add-on. Thankfully the CLI takes care of most of this for us.
Expand Down Expand Up @@ -63,8 +65,8 @@ class Amazing_add_on_upd extends Installer
The first thing you will notice in our `Amazing_add_on_upd` class is a list of properties that describe some specifics of our add-on to ExpressionEngine. There are two required properties to declare here:

```
public $has_cp_backend = 'y'; // Shows the option to see addon’s settings.
public $has_publish_fields = 'n'; // Whether module provides tab for entry edit page
public $has_cp_backend = 'y'; // Shows the option to see addon’s settings.
public $has_publish_fields = 'n'; // Whether module provides tab for entry edit page
```

## Install Your Add-On (`install()`)
Expand All @@ -77,23 +79,25 @@ The CLI automatically generates our install method. This method will ensure that


```
public function install()
{
parent::install();
public function install()
{
parent::install();

// create a database table
// notify mission control
// add publish tabs
// create a database table
// notify mission control
// add publish tabs

return true;
}
return true;
}
```

### Adding Publish Tabs
Optionally add the publish page tab fields to any saved publish layouts. This is ONLY used if the module adds a tab to the publish page and it requires the [`tabs()` function](#add-publish-tabs-with-your-add-on-tabs):

ee()->load->library('layout');
ee()->layout->add_layout_tabs($this->tabs(), 'module_name');
```
ee()->load->library('layout');
ee()->layout->add_layout_tabs($this->tabs(), 'module_name');
```


## Add Publish Tabs With Your Add-on (`tabs()`)
Expand All @@ -104,25 +108,27 @@ Optionally add the publish page tab fields to any saved publish layouts. This is

An optional function included only if your add-on adds a tab to the publish page. This function should return a multidimensional associative array: the top array key consisting of the tab name, followed by any field names, with each field having a variety of default settings. Note that when the fields are added to the publish page, they are namespaced to prevent variable collisions:

function tabs()
{
$tabs['tab_name'] = array(
'field_name_one'=> array(
'visible' => 'true',
'collapse' => 'false',
'htmlbuttons' => 'true',
'width' => '100%'
),
'field_name_two'=> array(
'visible' => 'true',
'collapse' => 'false',
'htmlbuttons' => 'true',
'width' => '100%'
),
);

return $tabs;
}
```
function tabs()
{
$tabs['tab_name'] = array(
'field_name_one'=> array(
'visible' => 'true',
'collapse' => 'false',
'htmlbuttons' => 'true',
'width' => '100%'
),
'field_name_two'=> array(
'visible' => 'true',
'collapse' => 'false',
'htmlbuttons' => 'true',
'width' => '100%'
),
);

return $tabs;
}
```

Be sure that you also update your [`install()` function](#adding-publish-tabs) to add your specified tabs.

Expand All @@ -138,22 +144,24 @@ The `update` method will run code when a user installs an update to our add-on.
| \$current | `string` | The last recorded version of the module in the `exp_modules` table |
| Returns | `Boolean` | `FALSE` if no update is needed, `TRUE` otherwise

public function update($current = '')
{
// Runs migrations
parent::update($current);
```
public function update($current = '')
{
// Runs migrations
parent::update($current);

// only run the update if the user is currently running a version less than 2.0
if (version_compare($current, '2.0', '<'))
{
// Do your update code here
// update database
// notify mission control of the update
}
// only run the update if the user is currently running a version less than 2.0
if (version_compare($current, '2.0', '<'))
{
// Do your update code here
// update database
// notify mission control of the update
}


return true;
}
return true;
}
```

## Uninstall Your Add-On (`uninstall()`)
The CLI automatically generates our uninstall method. This method will ensure that all extensions and actions declared above will be properly uninstalled. Similarly to installation, if you just need to ensure your actions and extensions are uninstalled, you can leave this method as is. However, you added custom functionality in the `install()` method, then you need to also ensure you clean up after yourself here.
Expand All @@ -162,19 +170,23 @@ The CLI automatically generates our uninstall method. This method will ensure th
| --------- | --------- | ------------------------------------------------------------ |
| Returns | `Boolean` | `TRUE` if everything uninstalled properly, `FALSE` otherwise |

public function uninstall()
{
parent::uninstall();
```
public function uninstall()
{
parent::uninstall();

// remove my database tables
// remove any publish tabs
// turn off the lights
// remove my database tables
// remove any publish tabs
// turn off the lights

return true;
}
return true;
}
```

### Removing Tabs
Optionally delete any publish page tab fields saved in publish layouts. This is ONLY used if the module adds a tab to the publish page and it requires the `tabs()` function:

ee()->load->library('layout');
ee()->layout->delete_layout_tabs($this->tabs(), 'module_name');
```
ee()->load->library('layout');
ee()->layout->delete_layout_tabs($this->tabs(), 'module_name');
```
14 changes: 14 additions & 0 deletions docs/development/extension-hooks/model/channel-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,17 @@ How it's called:
ee()->extensions->call('after_channel_entry_bulk_delete', $delete_ids);

TIP: **New in version 4.3.0.**

## `before_channel_entry_version_delete($entry, $delete_versions)`

| Parameter | Type | Description |
| ------------ | ------- | ---------------------------------------- |
| \$entry | `Object` | Current ChannelEntry model object |
| \$delete_versions | `Array` | Versions to be deleted |
| Returns | `Array` | Modified array of Versions to be deleted |

Called after an entry is saved before Versions are deleted if versioning is enabled for the entry's channel.

How it's called:

$versions = ee()->extensions->call('before_channel_entry_version_delete', $this, $versions);
37 changes: 37 additions & 0 deletions docs/installation/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,43 @@
-->
# ExpressionEngine v7 Change Log

## Version 7.5.8
(Release: March 4th, 2025)

<div class="max-w-7xl mx-autotext-center">
<div class="space-y-8 sm:space-y-12">
<ul role="list" class="mx-auto grid grid-cols-2 gap-x-4 gap-y-1 sm:grid-cols-4 md:gap-x-6 lg:max-w-5xl lg:gap-x-8 lg:gap-y-1 xl:grid-cols-5">

<li><div class="space-y-4 text-center"><img class="mx-auto h-20 w-20 rounded-full lg:w-24 lg:h-24" src="https://avatars.githubusercontent.com/u/563996?v=4" /><div class="space-y-2"><div class="text-xs font-medium lg:text-sm"><p class="mb-1">Bryan Nielsen</p><p class="text-indigo-600"><a href="https://github.com/ExpressionEngine/ExpressionEngine/commits?author=bryannielsen" target="_BLANK">@bryannielsen</a></p></div></div></div></li>
<li><div class="space-y-4 text-center"><img class="mx-auto h-20 w-20 rounded-full lg:w-24 lg:h-24" src="https://avatars.githubusercontent.com/u/2423727?v=4" /><div class="space-y-2"><div class="text-xs font-medium lg:text-sm"><p class="mb-1">Eric Swierczek</p><p class="text-indigo-600"><a href="https://github.com/ExpressionEngine/ExpressionEngine/commits?author=swierczek" target="_BLANK">@swierczek</a></p></div></div></div></li>
<li><div class="space-y-4 text-center"><img class="mx-auto h-20 w-20 rounded-full lg:w-24 lg:h-24" src="https://avatars.githubusercontent.com/u/13821249?v=4" /><div class="space-y-2"><div class="text-xs font-medium lg:text-sm"><p class="mb-1">JCOGS Design</p><p class="text-indigo-600"><a href="https://github.com/ExpressionEngine/ExpressionEngine/commits?author=jcogs-design" target="_BLANK">@jcogs-design</a></p></div></div></div></li>
<li><div class="space-y-4 text-center"><img class="mx-auto h-20 w-20 rounded-full lg:w-24 lg:h-24" src="https://avatars.githubusercontent.com/u/23382425?v=4" /><div class="space-y-2"><div class="text-xs font-medium lg:text-sm"><p class="mb-1">Yulya Lebed</p><p class="text-indigo-600"><a href="https://github.com/ExpressionEngine/ExpressionEngine/commits?author=Yulyaswan" target="_BLANK">@Yulyaswan</a></p></div></div></div></li>
<li><div class="space-y-4 text-center"><img class="mx-auto h-20 w-20 rounded-full lg:w-24 lg:h-24" src="https://avatars.githubusercontent.com/u/752126?v=4" /><div class="space-y-2"><div class="text-xs font-medium lg:text-sm"><p class="mb-1">Yuri Salimovskiy</p><p class="text-indigo-600"><a href="https://github.com/ExpressionEngine/ExpressionEngine/commits?author=intoeetive" target="_BLANK">@intoeetive</a></p></div></div></div></li>
<li><div class="space-y-4 text-center"><img class="mx-auto h-20 w-20 rounded-full lg:w-24 lg:h-24" src="https://avatars.githubusercontent.com/u/17011377?v=4" /><div class="space-y-2"><div class="text-xs font-medium lg:text-sm"><p class="mb-1">brad</p><p class="text-indigo-600"><a href="https://github.com/ExpressionEngine/ExpressionEngine/commits?author=bakin1999" target="_BLANK">@bakin1999</a></p></div></div></div></li>
<li><div class="space-y-4 text-center"><img class="mx-auto h-20 w-20 rounded-full lg:w-24 lg:h-24" src="https://avatars.githubusercontent.com/u/1181219?v=4" /><div class="space-y-2"><div class="text-xs font-medium lg:text-sm"><p class="mb-1">robinsowell</p><p class="text-indigo-600"><a href="https://github.com/ExpressionEngine/ExpressionEngine/commits?author=robinsowell" target="_BLANK">@robinsowell</a></p></div></div></div></li>
</ul>
</div>
</div>


**Enhancements** 🚀

- Removed unnecessary indentation in "update version" sidebar item; [#4721](https://github.com/ExpressionEngine/ExpressionEngine/pull/4721)
- Add method to list indexes for a given table #4710 ; [#4571](https://github.com/ExpressionEngine/ExpressionEngine/pull/4710)
- Updated sidebar version section to be red with white color when theres a critical update [#4706](https://github.com/ExpressionEngine/ExpressionEngine/pull/4706)
- Decouple site query from log query when viewing CP logs [#4703](https://github.com/ExpressionEngine/ExpressionEngine/pull/4703)
- Updated drop-down filter controls to show as much of the filter value as possible [#4581](https://github.com/ExpressionEngine/ExpressionEngine/discussions/4581)

**Bug Fixes** 💃🐛

- Resolved an issue where numeric channel shortnames caused a js error in Pro Search settings [#4709](https://github.com/ExpressionEngine/ExpressionEngine/pull/4709)
- Resolved [#4576](https://github.com/ExpressionEngine/ExpressionEngine/issues/4576) where replace in Pro Search did not work with shared Grid fields

**Developers** 💻

- Added before_version_delete hook to entry versioning [#4694](https://github.com/ExpressionEngine/ExpressionEngine/pull/4694)
- Treat smart quotes more lightly when searching [#4359](https://github.com/ExpressionEngine/ExpressionEngine/discussions/4359)

## Version 7.5.7
(Release: January 23nd, 2025)

Expand Down