# Question
Title: Define Database Error (Upgrading 2.10.1 to 3)
I apologize for a question that I know has been asked and answered. However, I don't have enough reputation to reply to the answer, just to provide another "answer", which I don't have. Instead I have a complication.

I've grabbed my v3 files from this post, which I began following last year when I upgraded from 1 to 2. I've procrastinated upgrading to 5, but would like to do so within the next day or two if possible. The error I'm running into can be found in this post, which is where the problem arises: that's not what my config file looks like.

```
$config['app_version'] = '2.10.1';
$config['license_contact'] = "";
$config['license_number'] = '';
$config['debug'] = '1';
$config['cp_url'] = '';
$config['doc_url'] = 'http://ellislab.com/expressionengine/user-guide/';
$config['is_system_on'] = 'y';
$config['allow_extensions'] = 'y';
$config['cache_driver'] = "";
$config['install_lock'] = '1';
$config['db_hostname'] = '';
$config['db_username'] = '';
$config['db_password'] = '';
$config['db_name'] = '';
$config['db_type'] = 'mysql';
$config['db_prefix'] = 'exp';
$config['db_conntype'] = '0';
$config['system_folder'] = 'system';
$config['cookie_prefix'] = '';
$config['multiple_sites_enabled'] = 'n';

```

That's a blank example of what my config.php file in the user folder looks like. I followed the official instructions and yet hit this error. Is this an outdated config file? Could my database.php file also be outdated? Is there an empty config file I can use that's more up-to-date and in line with the answer from the other post?

I'm sorry to create a new question for something that's been answered, but that answer only provided more questions and StackExchange won't let me address that person's reply directly. Any assistance on this matter is appreciated.

Oh, and for what it's worth, I'm not using any 3rd party add-ons, so my step-by-step upgrade shouldn't be that much of a hassle. Shouldn't be. Sadly, it seems to be.

Thank you for any assistance.

# Answer
So I figured out the real problem. The actual answer can be found over here.

I downloaded the Master of 3 from GitHub rather than the files with 3.5 with the actual installer. So I was following the official instructions correctly, just didn't grab the correct files. So if you run into this error, it has nothing to do with your config files. You need to grab the .zip (NOT source code) from this page.

Thanks to those that replied and tried to help me work through this.
> 0 votes

# Answer
Unclear from question if you have an issue, or are trying to pre-empt an issue.

I *think* you are saying you plan to upgrade and are concerned that your config.php file does not look like the example @jrothafer suggests in the answer you link to.

EE2 splits the config information between `config.php` and `database.php` \- in EE3 and up the two files are merged into a single combined `config.php` file; in that file the format for defining the database connection is a bit different to that used in the EE2 `database.php` file.

So it is no surprise that the config.php file you have looks different - you did not include the database.php information, and it is a different format anyhow.

EE will rewrite your EE2 config files into a new conformant one during the upgrade process - so provided your EE2 site can access its database before the update, you should be good after the update also.

HTH - if I have misunderstood your question perhaps you can clarify the question where I'm mistaken, and I'll try to improve the answer...

**additional based on your comment**

If you want to manually add the database configuration to an EE3 config.php file you need to complete / add entries similar to the following:

```
    'expressionengine' => array(
        'hostname' => ' ... ', // Could be an IP, 'localhost', or a valid DNS lookup
        'database' => ' ... ', // The name of your EE database
        'username' => ' ... ', // The username of a super-admin account
        'password' => ' ... ', // A password for the super-admin account
        'dbprefix' => 'exp_',
        'char_set' => 'utf8mb4',
        'dbcollat' => 'utf8mb4_unicode_ci',
        'port'     => ''
    ),

```

HTH
> 0 votes

---
Tags: ee3, database, ee2-upgrades, config, database-error
---


# Question
Title: Upload Image/File Modal Empty, Potential JS Error in index.php?
Sorry for another potentially simple question. I've successfully managed to upgrade to EE 5.3.2, and everything seems to be working 99% correctly. Only two issues needed to be corrected. The first was that I needed to update the directory of emoticons/emojis in my settings. The second, however, seems to be that the image upload modal in my Create New Entry page will not work.

This is what I'm getting when I click on the icon to upload an image into any text field where images are permitted/intended.

There is a JavaScript error that I'm not sure is at fault or not. It occurs on index.php line 722 for me. The error is:

Unfortunately, it's not the most clear error, which is one of the reasons I don't know how to search for info on it. I have no clue if this is related to the empty modal or not, but it seems like something I should look into. The specific error in Chrome's console is: **GET** http://www.url.com/system/index.php?S=a4a3cfc8698b1994e6b6b14b73300c66&D=cp&C=javascript&M=combo\_load&file=cp/global\_end,cp/files/picker,fields/textarea/cp,cp/date\_picker&v=1600791531 **net::ERR\_ABORTED 406 (Not Acceptable)**

I wish I had a more clear question to ask. If anyone can help me out, please do. Thanks!

# Answer
It looks like something may be tripping up a mod\_security rule on the server, that can happen from time to time if the rules are too strict.

How to check:

1. Make the error happen using the field, make a note of the time
2. Check server logs to see if any mod\_sec rules have been triggered
3. Disable any triggered rules
4. Test the field again, is mod\_sec was the problem the field should work as expected
> 1 votes

---
Tags: file-uploads, image, entry, ee5, modal
---


# Question
Title: Error when creating new channel: Unknown field ChannelField.group_id
I have this nagging issue on a site and I can't track down the cause..

When I attempt to create a new channel, I get: Unknown field ChannelField.group\_id

This site has been updated over time and never got an error while updating.. now it's at 5.3.1.

I have compared the tables with a fresh install and cant find any missing fields...

Anyone else had this?

```
ee/EllisLab/ExpressionEngine/Service/Model/Query/Select.php:776

Stack Trace: Please include when reporting this error

#0 ee/EllisLab/ExpressionEngine/Service/Model/Query/Select.php(633): EllisLab\ExpressionEngine\Service\Model\Query\Select->translateProperty('group_id')
#1 ee/EllisLab/ExpressionEngine/Service/Model/Query/Select.php(620): EllisLab\ExpressionEngine\Service\Model\Query\Select->applyFilter(Object(EllisLab\ExpressionEngine\Service\Database\Query), Array)
#2 ee/EllisLab/ExpressionEngine/Service/Model/Query/Select.php(116): EllisLab\ExpressionEngine\Service\Model\Query\Select->applyFilters(Object(EllisLab\ExpressionEngine\Service\Database\Query), Array)
#3 ee/EllisLab/ExpressionEngine/Service/Model/Query/Select.php(48): EllisLab\ExpressionEngine\Service\Model\Query\Select->buildQuery()
#4 ee/EllisLab/ExpressionEngine/Service/Model/DataStore.php(282): EllisLab\ExpressionEngine\Service\Model\Query\Select->run()
#5 ee/EllisLab/ExpressionEngine/Service/Model/DataStore.php(228): EllisLab\ExpressionEngine\Service\Model\DataStore->runQuery('Select', Object(EllisLab\ExpressionEngine\Service\Model\Query\Builder))
#6 ee/EllisLab/ExpressionEngine/Service/Model/Query/Builder.php(144): EllisLab\ExpressionEngine\Service\Model\DataStore->selectQuery(Object(EllisLab\ExpressionEngine\Service\Model\Query\Builder))
#7 ee/EllisLab/ExpressionEngine/Service/Model/Query/Builder.php(63): EllisLab\ExpressionEngine\Service\Model\Query\Builder->fetch()
#8 user/addons/calendar/ft.calendar.php(494): EllisLab\ExpressionEngine\Service\Model\Query\Builder->all()
#9 ee/legacy/libraries/api/Api_channel_fields.php(410): Calendar_ft->display_settings(Array)
#10 ee/EllisLab/ExpressionEngine/Model/Content/FieldFacade.php(226): Api_channel_fields->apply('display_setting...', Array)
#11 ee/EllisLab/ExpressionEngine/Model/Content/FieldModel.php(72): EllisLab\ExpressionEngine\Model\Content\FieldFacade->getSettingsForm()
#12 ee/EllisLab/ExpressionEngine/Controller/Channels/Channels.php(320): EllisLab\ExpressionEngine\Model\Content\FieldModel->getSettingsForm()
#13 ee/EllisLab/ExpressionEngine/Controller/Channels/Channels.php(166): EllisLab\ExpressionEngine\Controller\Channels\Channels->form()
#14 [internal function]: EllisLab\ExpressionEngine\Controller\Channels\Channels->create()
#15 ee/EllisLab/ExpressionEngine/Core/Core.php(241): call_user_func_array(Array, Array)
#16 ee/EllisLab/ExpressionEngine/Core/Core.php(110): EllisLab\ExpressionEngine\Core\Core->runController(Array)
#17 ee/EllisLab/ExpressionEngine/Boot/boot.php(151): EllisLab\ExpressionEngine\Core\Core->run(Object(EllisLab\ExpressionEngine\Core\Request))
#18 html/beheer.php(157): require_once('...')
#18 html/beheer.php(157): require_once('...')

```

# Answer
I know this is a bit old, but I had this issue on a site recently. Couldn't create or update channels or fields. Turns out it was the Solspace Calendar module. Uninstalling it fixed the error, bit obviously deleted all the content.
> 1 votes

---
Tags: channel, error, database-error
---


title: Jpeg2000 or webp images with CE IMAGE?

text:
# Question
Title: Jpeg2000 or webp images with CE IMAGE?
Is it possible to use next-gen formats with CE Image, using Expression Engine 2.8?
What's the alternative?

# Answer
> 1 votes
CE-Image is pretty old now, and I'm also fairly sure it doesn't support outputing images in either webp or Jpeg2000 formats. Neither does any version of EE.

In theory CE-Image (or some equivalent) could *output* images in those formats, but due to limitations within EE it is pretty difficult to use either format as image sources within your site - EE's "File Manager" system does not currently recognise either format.

A better question to ask yourself though is why you would want to output images in either format in the first place: webp is not supported by macOS Safari yet, and only by the most recent version of iOS. Similarly Jpeg2000 has limited support (e.g. AFAIK it is still not supported on Firefox). So unless you are targetting a closed group of browsers that you know support the format, you'd need to provide an alternative image format in a more compatible format anyhow - so might as well just provide the compatible alternative...

HTH

---
Tags: ce-image
---


# Question
Title: Category Group id location in the control panel
I cannot find the category group id number anywhere in the control panel since I upgraded to EE5. I am building a search based on cat group but I have no idea what the values are and cannot find them. Can some enlighten me to where they are listed

# Answer
> 2 votes
When you are in the EE Control Panel go to `Developer/Categories` page and select a Category Group in LH pane: the category group ID is then shown as the final element of the URL - if you are viewing category group 1, your URL will look a bit like this:

```
domain.com/admin.php?/cp/categories/group/1

```

It would be helpful if the group ID number appeared in a more visible place; maybe that will happen in some future version of EE, but for now that should get you home.

HTH

---
Tags: categories, category-group
---


# Question
Title: How do I change the search frequency time limit?
EE 3.5.17

By default search frequency is set to 15 seconds. Is there a way to change that time limit?

I saw an old post from 2007 that said it was under Member Group settings, but I don't see anything like that.

Any suggestions?

Thanks.

# Answer
> 2 votes
It is in Member Group settings, you have to enable "Access search facility" first, that will reveal the frequency field. Default in EE5 is 10 seconds.

---
Tags: search
---


# Question
Title: Displaying a product page with a list of all available relationships of a relationship field shown as a list, with the selected relationship flagged
My client needs to display the status of an order, so using relationship channel of order\_statuses.

The list of order statuses should be shown as:

* Order recieved
* Status 2
* \[TICK\] Status 3
* Status 4
* Status 5
* Order Complete

The tick shows that the order is at a specific point in the process...

I could probably use statuses, but need it to sit within a channel to give me more flexibility over what it can store. eg. status icon etc.

# Answer
I'd use an embed template inside the product to call all your "status" entries:

Product template example

```
{exp:channel:entries channel="products"}

    <!-- products title -->
    {title}

    <!-- call embed template with status id as reference -->
    {embed="my_group/my_embed_template" the_status_id="{status_relationship_field:entry_id}"}

{/exp:channel:entries}

```

Embed template example:

```
<ul>
<!-- loop through all statuses -->
{exp:channel:entries channel="order_statuses" dynamic="no"}
<li>
    <!-- compare order statuses entry id with embed reference from product -->
    {if entry_id == '{embed:the_status_id}'}<img src="{status_icon}">{/if}
    <!--  orders status title -->
    {title}
</li>
{/exp:channel:entries}
</ul>

```

Something like that!
> 0 votes

---
Tags: status, related-entries, reverse-related-entries, related
---


title: Freeform Next errors

text:
# Question
Title: Freeform Next errors
I get these errors when submitting a Solspace Freeform Next form. The submission is successful. Record is made, notifications are sent properly. Everything works otherwise.

EE 5.3.2 Freeform Next Light 1.8.3

L.

```
Notice

Trying to access array offset on value of type null

user/addons/freeform_next/vendor/egulias/email-validator/src/Egulias/EmailValidator/Parser/Parser.php, line 132

Severity: E_NOTICE
Warning

Cannot modify header information - headers already sent by (output started at ee/legacy/core/Exceptions.php:120)

ee/legacy/core/Input.php, line 238

Severity: E_WARNING
Warning

Cannot modify header information - headers already sent by (output started at ee/legacy/core/Exceptions.php:120)

user/addons/freeform_next/Utilities/Plugin.php, line 57

Severity: E_WARNING

```

# Answer
> 0 votes
Haven't heard this reported before and am not seeing it on our end. Can you create a support ticket for this, include more info like PHP version, etc, and we'll look into the issue there? :)

https://docs.solspace.com/expressionengine/freeform/v1/support.html

---
Tags: solspace-freeform-next
---


# Question
Title: Error when try to add new field: col_settings_tmpl.php
I'm using EE 2.7.3 and I'm getting the following error when trying to create or edit a field: Unable to load the requested file: col\_settings\_tmpl.php . It seems to be related to the grid field type, disabling it as suggested elsewhere is not really an option as it's used throughout the site.

The site works correctly when I set it up locally, but I get the above error when I move it to the live server.

Thanks,

# Answer
> 2 votes
I had this problem just now.

For me.. it was due to a duplicate of a third party module left over from when i updated.

Basically i was updating low variables and duplicated the exisitng files just as a safety net... so i had a folder called 'low\_variables - copy'

Once i removed that everything worked as normal.

# Answer
> 0 votes
I have debugged the code of the file "admin or system\codeigniter\system\core\Loader.php" and found that one backup of the folder of the forms addon in the third-party addon so I have removed it and now working fine.

> How can we found it?

We need to print\_r the **"$this-\>\_ci\_view\_paths"** this variable in "admin or system\codeigniter\system\core\Loader.php" file and found that return array of the paths and there is some file path as key have not value as "1" for that path that means that folder path is duplicated or it has some issue. so remove that folder and try again.

> **Second solution for after upgraded to EE 2.11.1**

After upgrading 2.11.1 to 2.11.9 then I have faced the same error again. So I have debugged again. Print the path and array according the below screenshot in the Loader.php file

Here, you can see the col\_settings\_tmpl.php file is trying to getting form the system or admin/expressionengine/views folder so something is wrong because this path have not that type of file. so I have tried to clear cache but no luck.

Then temporary, I have comment the show\_error function line as per the blow screenshot and everything is fine. But I know that this is the not proper way by using that I know this path related setting is not necessary for the edit field setting page.

---
Tags: grid
---


# Question
Title: Remove all URL-segments except for url-title?
right now I have an URL-structure like

```
www.xy.com/channel/template/url-title

```

Is it possible to get an url-structure like

```
www.xy.com/url-title

```

instead, removing all segments except the url-title? Maybe with the help of template routes, but I am not sure how to use it in this case.

Thanks for any hints!!

# Answer
Whether you can depends somewhat on how your site / templates are designed.

As far as EE is concerned, you don't really need to specify which channel or anything to retrieve an entry - the `url_title` is enough on its own. So if you want to use the url structure `domain.com/url_title` there is no reason why you could not do use a template design like this:

```
{exp:channel:entries url_title="{segment_1}" ... other parameters ... }
    <h1>The title of this entry is {title}.</h1>
{/exp:channel:entries}

```

By itself the weakness with this approach is that it sort of pushes you to having one template to drive the whole site... which undermines some of the strength of EE as a CMS: having other segments in the URL is useful to help direct EE towards which template group to use, and to drive some features and responses arising from the user's activities on the site. But if having just one segment is important to you, you can maybe work around this by building in conditional logic to your master template... there are two things that might be worth considering:

* Once you have retrieved a channel entry using the `url_title` you can then access other information about the entry - such as what channel it is in, its ID, what categories have been assigned to it etc;
* The EE tempate layout system is quite flexible and allows you to build a template step-by-step based on information retrieved in earlier templates.

So you could have a 'parent' template that simply runs a channel entry call with the url\_title, and then has a bunch of conditional logic to work out what template to load based on what information you retrieve from that call.

To do the redirect to the correct template without messing with the URL, you need one more trick. EE (at least up to EE5) does not allow for conditional terms in template layout tags, but does allow you to use layout variables - so use this switching approach you need to do a two-step thing:

1. Set the parent template to transfer processing to a fixed template (do this by putting `{layout='some_template_group/some_template}` as the first line of your parent template.
2. In your parent template use your conditional logic to identify the correct template to use (and any other important information derived from this knowledge) and use this to set the value for a layout variable (call it something like `processing_template`) - so something like

```
{layout:set name="processing_template"}template_group/template{/layout:set}

```
3. Then put this entry as your first line of the 'processing\_template\`

```
{layout='{layout:processing_template}'}

```

Then EE when it processes one of your single term URLs will not only process the parent template, but also append the content of whatever other template you want based on the conditional logic processing...

Hope this helps.
> 1 votes

---
Tags: url, url-title, template-routes
---


# Question
Title: Redirect url from /blog/singlepage/entry_id to /blog/singlepage/url-title
I have two types of urls for each posting on my EE5-installation, namely

```
www.xy.com/blog/singlepage/url_title

www.xy.com/blog/singlepage/entry_id

```

The reason for this doubling lies back in ancient times, I want to remove this.

Is it possible to somehow redirect all

```
www.xy.com/blog/singlepage/entry_id

```

to

```
www.xy.com/blog/singlepage/url_title

```

?

Another one had the problem other way round, but I am not sure if the answer to his question is fitting my needs. Another idea would be to use the addon Detour, but I am not sure if this could do the trick. Also I would prefer to do it without a plugin if possible.

I would appreciate help very much, thanks!

# Answer
It would be possible, if you don't mind doing a page reload as part of the process.

EE can find an entry with just the `url_title` or `entry_id`, so all you need to do is create a default template that is loaded in response to the url form `blog/singlepage` (e.g. by creating a template group `blog` and putting within it a template `singlepage.html`) and put in that template something like this...

```
{if segment_3 && segment_3 ~ "/^[0-9]*$/"} // segement_3 is a number - so probably an entry_id
   {exp:channel:entries entry_id='{segment_3}' dynamic='no'}
        {redirect='blog/singlepage/{url_title}' status_code='301'}
   {exp:channel:entries}
{/if}

// otherwise we probably have url_title so try loading the normal template

{exp:channel:entries url_title='{segment_3}'}
... template stuff ...
{/exp:channel:entries}

```

HTH
> 1 votes

# Answer
If you want to redirect your entry\_id URL's JCOGS solution is good because you keep it to using native EE functionality and it's easy to remove when you no longer need it. Additionally you get a proper 301 added to the redirect to tell search engines the new location for the page so they can reindex.

You could always add redirects to .htaccess or use Detour Pro but either way you'll still have a page redirect!
> 0 votes

---
Tags: url, redirects, ee5, url-title
---


# Question
Title: Datagrab import, relationshipfield inside grid
I'm trying to achieve an import with datagrab with the following field construction:

A grid, and inside a grid I have a column with a relationship field (and some other normal text field inputs in the other columns).

When I import a csv, it looks like Datagrab doesn't process these relationship fields at all inside a grid. Whereas standalone relationship fields do seem to import fine.

Am I missing something? Is there any way to import a relationship inside a grid or do I actually need to hack Datagrab or create custom extension code for it?

# Answer
This is one that really you should direct to the author of Datagrab... it is quite possible though that the add-on does not support the importing of relationships within grids.

The datagrab web site suggests there is a support forum for such requests, but that appears to be offline, so the alternatives to fill in the contact form or send in an email (address given on contact page).

HTH

> PS - in passing, good practice is to include information in a question about the version of EE that you are using, and of any add-on you are asking about - to make it easier for people to answer; there are significant differences between versions of EE, and in some add-ons etc.
> 1 votes

# Answer
Not a full solution, but when Datagrab doesn't support some types of field data I import data into a temporary textarea field or two, then go through entries one by one and update. It doesn't take long to do with a couple of hundred entries, but if you have thousands of entries you might need to set aside a few days!
> 0 votes

---
Tags: relationships, grid, import, datagrab
---


# Question
Title: Site was working, but this morning there is an error showing. mysqli_connection.php:117
I installed the site with whatever the version was 5 months ago. When I log into the control panel, I get this. I don't know what any of it means and I'm desperate to get my site up and running again.

It was a clean install, not an upgrade. No plugins or add ons. It was working perfectly till it wasn't.

Can anyone help?

> Exception Caught
>
> SQLSTATE\[HY000\]: General error: 1835 Malformed communication packet: SELECT LOWER(module\_name) AS module\_name, module\_version, has\_cp\_backend, module\_id FROM (`exp_modules`)
>
> ee/legacy/database/drivers/mysqli/mysqli\_connection.php:117
>
> Stack Trace: Please include when reporting this error
>
> #0 ee/legacy/database/drivers/mysqli/mysqli\_driver.php(112): CI\_DB\_mysqli\_connection-\>query('SELECT LOWER(mo...')
>
> #1 ee/legacy/database/DB\_driver.php(270): CI\_DB\_mysqli\_driver-\>\_execute('SELECT LOWER(mo...')
>
> #2 ee/legacy/database/DB\_driver.php(180): CI\_DB\_driver-\>simple\_query('SELECT LOWER(mo...')
>
> #3 ee/legacy/database/DB\_active\_rec.php(1138): CI\_DB\_driver-\>query('SELECT LOWER(mo...')
>
> #4 ee/legacy/models/addons\_model.php(215): CI\_DB\_active\_record-\>get('modules')
>
> #5 ee/EllisLab/ExpressionEngine/Service/Addon/Addon.php(57): Addons\_model-\>get\_installed\_modules()
>
> #6 ee/EllisLab/ExpressionEngine/Service/Addon/Factory.php(85): EllisLab\ExpressionEngine\Service\Addon\Addon-\>isInstalled()
>
> #7 \[internal function\]: EllisLab\ExpressionEngine\Service\Addon\Factory-\>EllisLab\ExpressionEngine\Service\Addon{closure}(Object(EllisLab\ExpressionEngine\Service\Addon\Addon))
>
> #8 ee/EllisLab/ExpressionEngine/Service/Addon/Factory.php(86): array\_filter(Array, Object(Closure))
>
> #9 ee/EllisLab/ExpressionEngine/app.setup.php(479): EllisLab\ExpressionEngine\Service\Addon\Factory-\>installed()
>
> #10 \[internal function\]: EllisLab\ExpressionEngine\Core\Application-\>{closure}(Object(EllisLab\ExpressionEngine\Core\Provider))
>
> #11 ee/EllisLab/ExpressionEngine/Core/Provider.php(330): call\_user\_func\_array(Object(Closure), Array)
>
> #12 ee/EllisLab/ExpressionEngine/Service/Dependency/InjectionContainer.php(129): EllisLab\ExpressionEngine\Core\Provider-\>EllisLab\ExpressionEngine\Core{closure}(Object(EllisLab\ExpressionEngine\Service\Dependency\InjectionContainer))
>
> #13 ee/EllisLab/ExpressionEngine/Service/Dependency/InjectionContainer.php(109): EllisLab\ExpressionEngine\Service\Dependency\InjectionContainer-\>singleton(Object(Closure))
>
> #14 \[internal function\]: EllisLab\ExpressionEngine\Service\Dependency\InjectionContainer-\>EllisLab\ExpressionEngine\Service\Dependency{closure}(Object(EllisLab\ExpressionEngine\Core\Provider))
>
> #15 ee/EllisLab/ExpressionEngine/Service/Dependency/InjectionContainer.php(182): call\_user\_func\_array(Object(Closure), Array)
>
> #16 \[internal function\]: EllisLab\ExpressionEngine\Service\Dependency\InjectionContainer-\>make(Object(EllisLab\ExpressionEngine\Core\Provider), 'ee:Model/Datast...')
>
> #17 ee/EllisLab/ExpressionEngine/Service/Dependency/InjectionBindingDecorator.php(77): call\_user\_func\_array(Array, Array)
>
> #18 \[internal function\]: EllisLab\ExpressionEngine\Service\Dependency\InjectionBindingDecorator-\>make('ee:Model/Datast...')
>
> #19 ee/EllisLab/ExpressionEngine/Core/Provider.php(368): call\_user\_func\_array('parent::make', Array)
>
> #20 ee/EllisLab/ExpressionEngine/app.setup.php(227): EllisLab\ExpressionEngine\Core\Provider-\>make('Model/Datastore')
>
> #21 \[internal function\]: EllisLab\ExpressionEngine\Core\Application-\>{closure}(Object(EllisLab\ExpressionEngine\Core\Provider))
>
> #22 ee/EllisLab/ExpressionEngine/Core/Provider.php(330): call\_user\_func\_array(Object(Closure), Array)
>
> #23 \[internal function\]: EllisLab\ExpressionEngine\Core\Provider-\>EllisLab\ExpressionEngine\Core{closure}(Object(EllisLab\ExpressionEngine\Service\Dependency\InjectionContainer))
>
> #24 ee/EllisLab/ExpressionEngine/Service/Dependency/InjectionContainer.php(182): call\_user\_func\_array(Object(Closure), Array)
>
> #25 ee/legacy/libraries/Core.php(106): EllisLab\ExpressionEngine\Service\Dependency\InjectionContainer-\>make('Model')
>
> #26 ee/legacy/core/Controller.php(65): EE\_Core-\>bootstrap()
>
> #27 ee/legacy/core/Controller.php(76): Base\_Controller-\>\__construct()
>
> #28 ee/legacy/core/Controller.php(99): EE\_Controller-\>\__construct()
>
> #29 ee/EllisLab/ExpressionEngine/Core/Core.php(228): CP\_Controller-\>\__construct()
>
> #30 ee/EllisLab/ExpressionEngine/Core/Core.php(110): EllisLab\ExpressionEngine\Core\Core-\>runController(Array)
>
> #31 ee/EllisLab/ExpressionEngine/Boot/boot.php(151): EllisLab\ExpressionEngine\Core\Core-\>run(Object(EllisLab\ExpressionEngine\Core\Request))
>
> #32 admin.php(153): require\_once('...')
>
> #32 admin.php(153): require\_once('...')

# Answer
> 0 votes
If you have not changed anything in your site, it is unlikely that the cause is going to be within EE... so the other thing to consider is whether there has been a change to your database server that you were not aware of - there are reports of changes / updates to (for example) MariaDB triggering the same error in other apps (e.g. here).

---
Tags: php, mysql
---


# Question
Title: Extensions Error and Unable to Login After Upgrade from EE2 to EE3
My hosting company upgraded to PHP 7 recently which rendered an old site running EE2 inaccessible on the front end and admin sides. I completed an upgrade from EE2 to EE3.5.17 after reading that EE3 was compatible with PHP 7 hoping this would be an easy fix. The upgrade went well through the installation until I got the following error and can't access the admin side.

Unable to load the following extension file: ext.dry\_accessible\_captcha.php

I did some research and read where all add-ons not compatible with EE3 needed to be removed prior to completing the upgrade. However, in this case, I was not able to do this since I did not have access after my hosting company made the PHP update. Any ideas on a workaround to get me up and running?

# Answer
You have a few options.

If it's just extensions, you can use this configuration override to disable all extensions:

```
$config['allow_extensions'] = 'n';

```

Add that line to the end of your `config.php` file. That might allow you access to your Control Panel to move forward with removing add-ons.

Another option is to (**backup these tables first**) truncate your `exp_extensions` table and remove any non-first party rows from your `exp_modules` table. Your `exp_actions` table will be left with some orphaned rows from the modules you are ditching, likely, so pay attention to that.

But disabling extensions should get you back in to your Control Panel at least.
> 1 votes

---
Tags: ee3, error, login, upgrade, addons
---


# Question
Title: Any way to restrict image size on upload?
I have some fields where multiple images are uploaded. These images need to be created manually to ensure they're cropped correctly, and I want to ensure that each field only accepts an image cropped to exact dimensions. I don't want to crop the images programatically.

For example, field 1 accepts an image cropped exactly to 1000px by 300px, field 2 accepts 700px by 250px, and so on.

Wondering if there's any way to have this kind of validation in Expression Engine, either with a plugin or core functionality?

# Answer
> 1 votes
In order for ExpressionEngine to know anything at all about the images they would first need to be uploaded.

Perhaps something like this? http://blueimp.github.com/jQuery-File-Upload/

You'd need to look for something that worked on the client side via Flash or Javascript which could test the file before the upload process starts.

# Answer
> 1 votes
From what i understand from your question you need Ansel: https://buzzingpixel.com/software/ansel-ee

We had some issues getting this to work with Zurb Foundation though. We implemented a solution with the help of https://fengyuanchen.github.io/cropperjs/

---
Tags: image, validation, crop
---


title: Error Syncing File

text:
# Question
Title: Error Syncing File
Client is running 3.5.14. They have a Team channel, with one of the fields to allow them to upload a vCard for the team member. Everthing is working fine. However, the client asked me today if there was a way to clean up the old files. I went into the Files area and they are not showing up. If I try to sync, I get the error message that "vcf: The file type you are attempting to upload is not allowed."

Anything I can do to fix this?

# Answer
Even though the files were uploading ok, I needed to reference it in system/ee/EllisLab/ExpressionEngine/Config/mimes.php file.

```
'text/x-vcard', // .vcf - vCard

```
> 2 votes

---
Tags: files
---


# Question
Title: WYSIWYG-editor removes template partials/template variables
I am using Wygwam as WYSIWYG-editor. Now when I add a template variable or template partial inside an html-tag in a field which uses Wygwam it will be removed when switching from source to visual.

That means I enter e.g. in the source-code something like

```
<a href="test1" {variable1}>test1</a>
<p>test{variable2}</p>

```

and after switching to Wysiwyg-layout the code changes to

```
<a href="test1">test1</a>
<p>test{variable2}</p>

```

Note that the variable outside the tag still is there (variable2), but the one inside the a-link is gone (variable1).

The "restrict allowed HTML"-setting is off, see image:

Possibly the CKEditor-setting "extraAllowedContent" could help me, but I am not sure and do not understand how I could change this setting.

Thanks for any help with this!

# Answer
I think Wyvern (an other wysiwyg) can "process" the ee variables and partials. https://expressionengine.com/add-ons/wyvern
> 1 votes

# Answer
I don't think template variables are supposed to be rendered inside WYGWAM to begin with. I just ran a test and the variable name `{tp_test}` was retained literally from Source to Preview, and then in an actual web page, as well.

EDIT: You can use https://expressionengine.com/add-ons/allow-ee-code to allow template code in fields.

So chasing if/when WYGWAM erases it is kind of a red herring. But yes the extraAllowedContent would fix that. e.g., I have "i\[\*\]" to allow everything inside `<i>` tags (FontAwesome).
> 0 votes

---
Tags: wygwam, wysiwyg, template-partials, ckeditor
---


# Question
Title: Block iframes (e.g. YouTube-embeds) - loading only after click?
I am looking for a possibility to block YouTube-iframes (and similar embeds) from loading/setting cookies until the user clicks or allows it deliberately. Certainly I would prefer using a native EE functionality, but I also would use an commercial addon.

Thanks for any hints!

# Answer
> 1 votes
It's not too bad!

In the control panel Settings \> Consent requests create a new request called "video\_consent" or similar, this name is used in the consent form, example below.

Now add the following code snippet to wherever you output your video:

```
    <!-- check if the consent has NOT been granted -->
    {if ! consent:has_responded:ee:video_consent}

        <!-- show the consent form-->
        {exp:consent:form consent='ee:video_consent' form_id='cookieConsentForm' form_class='consent-form'}

            <!-- get the consent input as a hidden field -->
            {consents}
                <input type="hidden" name="{consent_short_name}" value="y">
            {/consents}

            <button type="submit">Allow video</button>

        {/exp:consent:form}

    <!-- if consent has been granted show video code-->
    {if:else}

        Your video code

    {/if}

```

On submission of the form the page will reload and show your video code.

Not tested but give it a try!

# Answer
> 0 votes
You could use the Consent module for this. By default you'd prevent embed videos from loading and offer a consent form with whatever options you need. If consent is granted you'd probably want to reload the current page, but this time with the embed code present.

---
Tags: cookies
---


title: Hotel rooms reservation modul for EE 3

text:
# Question
Title: Hotel rooms reservation modul for EE 3
I would like to know if there is a quality module for booking hotel rooms for EE 3?

I have found this for EE 2, but I need it on EE3?

# Answer
I don't think so. But i wish. A booking addon would be amazing.. if you find one let me know
> 0 votes

---
Tags: ee3
---


title: Ecommerce add-ons: which options?

text:
# Question
Title: Ecommerce add-ons: which options?
Besides cartthrob is there any other alternative? After expresso store have been discontinued I’m looking for options for my next project

# Answer
I think it's the only option right now! Beside Simple commerce from EE which is very basic(not cart)
> 1 votes

---
Tags: expresso-store, cartthrob
---


# Question
Title: EE 5.3.2 - missing Upload Directory Synchronize function
Recently updated to EE 5.3.2 and i am no longer able synchronize my upload directory folders.

According to docs, i should have a Synch button under Files, but nothing there. https://docs.expressionengine.com/latest/control-panel/file-manager.html#sync-directory

Any ideas? Am i missing something?

# Answer
> 0 votes
OK, apparently those who worked on UX/UI of EE5 didn't realize how unbelievably unnoticeable their solution is.

You have to click on a Upload Directory, then up-top where it the header for FILE MANAGER exists, a new icon appears to sync. Great Job! really user friendly!

---
Tags: control-panel, ee5
---


# Question
Title: Error in admin.php or system/index.php when trying to upgrade to 5.4.0
I know I submit a lot of questions that are likely basic. I still haven't solved the last one that was asked.

I noticed that the "5.3.2" in the bottom of my control panel was now yellow, indicating an update. I was expecting it to be a simple update, but it instead provided the following error:

> It looks like your ExpressionEngine installation is using an out-of-date /admin.php or /system/index.php file. Please make sure you have the latest version of each file in place and then try upgrading again.

I did a Google and found this page regarding the same issue from a year ago (and version 4). Unfortunately, when examining my admin.php and system/index.php files and comparing to what he linked in the GitHub, it looks like I have the same file. I followed the manual update instructions when going all the way from 2 to 3 to 4 to 5, but it definitely felt like there were some holes in the process that EllisLabs themselves haven't addressed. Any advice or answers?

# Answer
> 1 votes
Hard to tell from your question what actually is going on, but here is a suggestion for a way forward:

* Download a clean copy of EE 5.4
* Create a clean / new install of EE 5.4 on some test system
* Copy the system / index files created in the new install
* Update the copied system / index files with relevant information from your existing system / index files
* Replace the system / index files on your 5.3.2 installation with the ones you've just created
* Try running the one-click updater again...

HTH

---
Tags: error, upgrade, ee5, update
---


# Question
Title: How do I display Relationship results from Low Search?
I have two channels, Products and Businesses. The Products channel has a relationship field that ties back to the business selling it. The products are returning successfully on my results page with keyword and categories. Unfortunately when I try and narrow the results for this relationship it does not work. The results page is displaying all products and not filtering the result. I know the entry\_id from the business is successfully passing through the form once a business is selected too.

The goal of this search filter is to display products related to a business. For example, if you select "Business Name" it will display the 10 products related to it.

I have tried a number of different parameters and I'm stuck. Thanks in advance!

**Form Code:**

```
    {exp:low_search:form result_page="shop/search" query="{segment_3}"}
        <input type="search" name="keywords" class="input-search" placeholder="Search Products" />
        <div class="select-dropdown">
            <select name="category[]">
                <option value="">Product Category</option>
                <option value="">--</option>
                {exp:channel:categories category_group="3" style="linear"}
                <option value="{category_id}"{if low_search_category ~ '/\b'.category_id.'\b/'} selected{/if}>{if parent_id != '0'} - {/if}{category_name}</option>
                {/exp:channel:categories}
            </select>
        </div>
        <div class="select-dropdown">
            <select name="child:product_seller[]">
                <option value="">Business Name</option>
                <option value="">--</option>
                {exp:channel:entries channel="neighborhood_business" orderby="title" sort="asc" limit="1000" dynamic="no"}
                <option value="{entry_id}">{title}</option>
                {/exp:channel:entries}
            </select>
        </div>
        <input type="submit" class="btn-submit" value="Search" />
    {/exp:low_search:form}

```

**Results Code:**

```
{exp:low_search:results query="{segment_3}" collection="shop_product" limit="18" paginate="bottom" paginate_base="shop/search/{segment_3}" keywords:inflect="yes"}
{if no_results}
<div class="searchNoResults">
    <p>Sorry, your search returned no results.</p>
</div>
{/if}
{if count == 1}
<div class="productItems">
{/if}

    <div class="item">
        <a href="{title_permalink='shop/product'}" title="Learn more about {product_title}">
            {if '{product_a_gift_card}' == 'Yes' AND '{product_image1}' == ''}
            <img src="{site_url}assets/img/shop/products/gift_card.png" alt="{title}" />
            {if:else}
            <img src="{product_image1:thumb}" alt="{title}" />
            {/if}
        </a>
        <div class="content">
            <p class="price">${product_price}</p>
            <h2><a href="{title_permalink='shop/product'}" title="Learn more about {product_title}">{product_title}</a></h2>
            <p class="business">By: {product_seller}{product_seller:title}{/product_seller}</p>
            <a href="{title_permalink='shop/product'}" class="cta-btn" title="Learn more about {product_title}">Learn More</a>
        </div>
    </div>

{if count == total_results}
</div>
{paginate}
<div class="paginationContainer">
    <p>Page {current_page} of {total_pages}</p>
    <div class="paginationLinks">{pagination_links}</div>
</div>
{/paginate}
{/if}
{/exp:low_search:results}

```

# Answer
> 1 votes
This was due to global setting being disabled. Filters can be enabled/disabled within the plugin's settings. One checkbox later and it works! Thanks for the fast support Low.

---
Tags: relationships, low-search
---


# Question
Title: White screen on multi site front end after upgrading Expressionengine
I have updated my system from 2.4 to 5.4 I have removed all plugins and extensions before upgrading, after upgrade the multi sites is showing a white screen in front end Knowing that the main website works perfectly, I have searched a lot but I didn't find anything that could help me , any suggestions?

# Answer
that might be all sorts of things. Generally it means there is a php error. -turn on show errors in the php settings -turn on show errors in EE If the main site is showing but the multi sites are not then i think you should place a new version (from the 5.4 zip) of the main index.php for the satellitet sites
> 4 votes

---
Tags: ee2-upgrades
---


title: Channel entries search by custom field

text:
# Question
Title: Channel entries search by custom field
Is its possible to get entries in view page related to current entry:

```
{exp:channel:entries dynamic="no" search:custom field="{exp:channel:entries}{custom field}{/exp:channel:entries}"}
{title}
{/exp:channel:entries}

```

I have tried with preload replace and stash but its not working

How to use stash to Preload replace?

Please help..

# Answer
> 2 votes
The channel entries call you are using to retrieve the custom field would need some more parameters to work - you need to give it some sort of channel or entry information for EE to work out what custom field value to return. Also, the syntax for field names requires them to be unbroken strings, so using the form `search:custom field=` will not work as `custom field` is not a valid field name.

Nesting channel entries calls like this is better done either using some mechanism to fetch and store the output before you run the main channel entries call, or by using the embed system (though this generally has more overhead, and so best avoided by using a store / retrieve solution if you can).

A simple way to do this would be to use a layout variable to store the custom field value before you construct the channel entries call with search term.

To save the value you'll need to add code a bit like this in a template

```
{layout="some_group/some_template"}
{layout:set name="some_variable"}
  {exp:channel:entries [some parameters]}
     {custom_field}
  {/exp:channel:entries}
{/layout:set}

```

and then this code in some later template in the chain (see note below)

```
{exp:channel:entries
    dynamic="no"
    search:custom_field"{layout:some_variable}"}
  ... add some variables etc ...
{/exp:channel:entries}

```

> **N.B.** You don't say which version of EE you are using - would help generally to add this to your questions as answers vary according to version in some cases.

To save the custom field to a layout variable means chaining at least two templates together, as layout variables are not available for use on the template they are saved on, only in later templates in the chain. So you may need to create a short template simply to do the saving, and then link to your main template from there.

The docs on layout variables are pretty good - so you should be able to work it out from there, but if you hit problems ask some more...!

HTH

---
Tags: channel-entries, channel, custom-fields, ee5
---


title: How to use italics in titles?

text:
# Question
Title: How to use italics in titles?
How do I italicize words in the title? The title field does not have a formatting panel under it like the body field.

# Answer
> 3 votes
There is no way within EE to italicise elements within a title string.

If you are looking to change the style of a word according to some pattern - e.g. to italicise the first word of the title regardless of what it says, or to italicise any use of the word "something" when ever it appears you would need to modify your site's CSS (and possibly add some Javascript) to achieve this result.

If you want the ability to add arbitrary rich text formatting to the string you are using for a title the only way to do this within EE is to use a different field to hold the title text you want to use (either a text input field set to accept Markdown formatting, or a Rich Text field).

To make it less confusing for editors, you can rearrange the CP fields and screens for that channel to put your alternative title field close to the actual title field.

HTH

---
Tags: title
---


# Question
Title: search:form require_all parameter is not returning the results as expected
According to Low Search's documentation on inclusive values:

I should be able to have the AND operator enabled when searching fields.

So I'm trying to filter my choices from a grid field column: `atttributen:waarde`

This grid can have many rows and with low\_search I want to be able to search for entries which have all the values which I have selected in my low\_search:form

In my low\_search form I've added this input:

```
<input type="hidden" name="require_all" value="search:attributen:waarde">

```

And have several inputs like this:

```
< input
    class="form-check-input filter"
    name='search:attributen:waarde[]'
    type="checkbox"
    value='xxxx_val_1'>
<input
    class="form-check-input filter"
    name='search:attributen:waarde[]'
    type="checkbox"
    value='xxxx_val_2'>

```

But strangely enough I'm experiencing different kind of behaviour when getting the results.

The below query string is being created automatically from the form submit, which I've managed to create with an ajax call:

```
ajax-results?search:attributen:waarde=xxxx_val_1|xxxx_val_2&require_all=search:attributen:waarde

```

but the above gives an empty result, whereas when I manually change the query to

`ajax-results?search:attributen:waarde=xxxx_val_1&&xxxx_val_2` then the resultspage DOES give me results.

According to the documentation, the first query should return the same results as the second query.

When I don't use the require\_all parameter, then I get results of entries with the OR (|) operator, but I'm actually trying to achieve to get entries which have specifically BOTH of the values inside the grid column.

Does anybody have an idea what I'm missing here? Thanks in advance!

Using EE 5.3.2, LowSearch 6.2.1

# Answer
Consider the native (regular) field search functionality. Say you have a `body` field. Using a `search:body="foo&&bar"` parameter will result in this where-clause:

```
WHERE (body LIKE '%foo%' AND body LIKE '%bar%')

```

...which is fine, because a long body field can easily contain both strings. Now consider your example, where you're targeting a Grid field column. Each column contains a specific string, like `foo` or `bar`. Using the `search:grid:column="foo&&bar"` will result in this where-clause

```
WHERE (column LIKE '%foo%' AND column LIKE '%bar%')

```

...but this is the issue. The WHERE clause targets *the same* column **and** row, which can never hold *both* keywords. This is why you're not getting any results. You should read the Grid column parameter as "Give me entries where the Grid column contains at least 1 row with values X *and* Y" instead of "Give me entries where the Grid column contains at least 1 row with value X *and* at least 1 row with value Y". The latter is currently not possible with Low Search.

As for why LS gives you results back when using `search:grid:column=foo&&bar` *in the query string*, that's because the `&` character delimits variables/params in the query string. That means the value in this example will be `foo` only, while `bar` is an empty variable:

```
[search:grid:column] => 'foo',
[] => '',
[bar] => '',

```

So you were only getting results where the Grid column matched the one term.
> 1 votes

---
Tags: low-search
---


# Question
Title: EE 6 Upgrade: System folder path not set correctly
I went through the upgrade from the latest previous version to EE6 using the automated button.

Everything came back green, except I'm now getting this error message:

```
Your system folder path does not appear to be set correctly. Please open the following file and correct this: index.php
```

My system folder is just "system" and both files appear to be set correctly. The only thing I can think of is that I had a soft-link to "backend", and when I did the upgrade, I was at "https://www.website.com/backend". I had never considered this an issue or possible item before.

(Renaming "system" to "backend" and updating the two php files does *not* resolve, unfortunately...)

Any help is greatly appreciated. :-D

# Answer
> 1 votes
You need to manually download and unzip the EE6 release. Then copy over the index.php and admin.php files and also the system/index.php file.

---
Tags: upgrade
---


# Question
Title: Low Search results when not encoding queries
I've been looking through this site for examples of Low Search results tags not using encoded queries but I can't find any and I think I must be doing something wrong.

By default on my page I have this which displays all results which is what I want:

```
{exp:low_search:results
    collection="people" {!-- have tried both channel and collection --}
    disable="member_data|relationships|trackbacks"
    orderby="people-lname"
    sort="asc"
    limit="10"
    pagination="bottom"
    {if segment_2}
    query="{segment_2}"
    {/if}
}

```

I also have a search form on the page:

```
{exp:low_search:form result_page="people"}
  <input type="text" name="keywords" id="keywords">
  <button>Submit</button>
{/exp:low_search:form}

```

If I do a search for a person's surname (which is part of the entry title), I end up on a page like `domain.com/people?keywords=surname` which is again what I want, but I get no results.

Edit: this is the output after turning on template debugging:

```
0.052283 / 3.2MB Calling Tag: {exp:low_search:form result_page="people"}
0.056505 / 3.4MB -> Data Returned
0.058679 / 3.4MB Calling Tag: {exp:low_search:results   channel="people"   disable="member_data|relationships|trackbacks"   orderby="people-lname"   sort="asc"   limit="10"   pagination="bottom"  }
0.062416 / 3.5MB Low Search: Applying Low_search_filter_keywords
0.063155 / 3.5MB Low Search: Keywords: surname
0.063360 / 3.5MB Low Search: Starting search (fulltext)
0.064107 / 3.5MB Low Search: Searched but found nothing
0.064146 / 3.5MB Low Search: Filters found no matches, returning no results
0.064183 / 3.5MB Returning No Results Content
0.064245 / 3.5MB -> Data Returned

```

# Answer
> 1 votes
Looking at the template debugging output, I can see the query is being picked up correctly and handled normally. If you're not getting results, make sure of the following:

Not using the `collection=` parameter will search all collections, but limit results to the given channel, ie. `people`. So, make sure the `people` channel has at least one collection associated and that collection has at least one searchable field **weighted 1 or more**. Fields with a weight of 0 are excluded from the index. Also make sure the index for that collection is built.

The debug data mentions "Searched but found nothing", which means a database query was fired using the given keywords (`surname`), but it didn't find a match in the collection index. This means either the above (the keyword is present, just not in the available collections and their weighted fields) or it means the keyword isn't present in the entries you're searching through, ie. no entries exist that contain the string `surname`.

---
Tags: low-search
---


# Question
Title: EE v2 to v5 upgrade SQL error when selecting channel for editing an entry
The upgrade from v2 to v5 working without error as did upgrading several plugins, however when in the control panel I and I select 'Edit' \> and a channel I get the following error:

```
SQLSTATE[23000]: Integrity constraint violation: 1052 Column ‘channel_id’ in where clause is ambiguous:

```

Code:

```
SELECT DISTINCT t.author_id, m.screen_name
FROM (exp_channel_titles t)
LEFT JOIN exp_members m ON m.member_id = t.author_id
WHERE channel_id = 83
ORDER BY screen_name asc

```

Any help identifying the cause of this error and providing a fix would be very much appreciated

Please note: I understand what the error means and how to fix it, what I need to know is what is going wrong and how to fix it in relation to the framework that it's used in Expression Engine.

# Answer
> 0 votes
To fix I simply removed the `channel_id` field from the `exp_members` table, it didn't have any useful info in it (every row was set to '0') and it isn't needed!

I'm not even sure why/how this column was added to the members table, members aren't really related to channels.

---
Tags: ee2-upgrades
---


# Question
Title: Freeform return_url with SUBMISSION_ID doesn't return to a page with an ID number
The docs for Freeform say the `return_url` should look like `return_url="{path='my/template/submission/SUBMISSION_ID'}"` but when I do that I end up on a page with URL = `/my/template/submission/SUBMISSION_ID`, i.e. `SUBMISSION_ID` doesn't get replaced with an actual ID.

I've also tried installing the demo templates which have the same and submitted the form, and get the same result.

What am I missing?

# Answer
> 0 votes
Are you storing submission data for the form? Please make sure to have the **Store Submitted Data** setting checked off inside the Settings tab in the form builder. Otherwise, this feature will not work correctly.

If that isn't the issue here, please submit a support ticket with more details and we can help you troubleshoot there. :)

---
Tags: solspace-freeform
---


title: EE6 Error Messages After Install

text:
# Question
Title: EE6 Error Messages After Install
Just tried installing EE6 on two different servers (one installation on MediaTemple, one on BlueHost) and in each case I am seeing error messages when trying to save URL and Path settings. Additionally I am seeing error messages on the front end home page. Both servers have been tested with ee\_wizard and are 100% compatible - I have extensive experience running EE on both hosting services for years. These are fresh installations of EE 6.0 - the errors are appearing immediately after running installation via admin.php.

```
Errors I am seeing after trying to save URL and Path Settings page in backend:

Warning
Invalid argument supplied for foreach()
ee/ExpressionEngine/Controller/Settings/Settings.php, line 209
Severity: E_WARNING

Warning
Cannot modify header information - headers already sent by (output started at ee/legacy/core/Exceptions.php:124)
ee/legacy/core/Input.php, line 265
Severity: E_WARNING

Warning
Cannot modify header information - headers already sent by (output started at ee/legacy/core/Exceptions.php:124)
ee/legacy/libraries/Functions.php, line 500
Severity: E_WARNING

```

```
Errors I am seeing on home page (with debugging enabled):

Notice
Only variables should be passed by reference
ee/legacy/libraries/Template.php, line 2256
Severity: E_NOTICE

Warning
Cannot modify header information - headers already sent by (output started at ee/legacy/core/Exceptions.php:124)
ee/ExpressionEngine/Boot/boot.common.php, line 495
Severity: E_WARNING

```

Any ideas what might be going on here?

# Answer
> 0 votes
I had some errors after upgrading too. I had to go back and make sure everything was set properly in the config.php instead of updating them from the CP however. Have you tried that?

---
Tags: php-errors
---


# Question
Title: Upgrade from 5.4 to 6 not supported from built in upgrader
My installation doesn't seem to support the built-in upgrader for the 5.4 to 6.0 jump. Previous upgrades worked nicely. Is this what everyone else is seeing too? I don't see this issue reflected in the docs.

Screenshot: https://share.getcloudapp.com/BluYXPLE

# Answer
Not sure why you don't see the integrated updater being flagged, but presumably you know that you can upgrade the installation manually \- not really so complicated.

HTH
> 0 votes

---
Tags: upgrade, ee5
---


title: Detour Pro not working on MSM setup

text:
# Question
Title: Detour Pro not working on MSM setup
In preparation for taking a MSM site offline, I have added redirects from this site to the default site, however these do not seem to be working.

A couple of simple examples (the 'from' site is of the form https://www.ourdomain.com/de/)

```
/       https://www.ourdomain.com/en/       NULL    NULL    301 2
blog    https://www.ourdomain.com/en/blog   NULL    NULL    301 2

```

# Answer
This was solved this by adding, either a wildcard character, or the site identifier to the beginning of the 'from' value:

```
de/blog    https://www.ourdomain.com/en/blog   NULL    NULL    301 2

```

Which I guess maybe due to the MSM path set up we have, ie as a postfix.
> 0 votes

---
Tags: multi-site-manager, detour-pro
---


# Question
Title: How to take out comma to the penultimate word in a list of 5 words?
```
{exp:query sql="SELECT states FROM states"}
    {if count == total_results}
        and {states}
    {if:else}
        {states},<span> </span>
    {/if}
{/exp:query}

```

Result: Colorado, Kentucky, Missouri, Oklahoma, and Tennessee But I'm expecting Colorado, Kentucky, Missouri, Oklahoma and Tennessee

Any idea?

# Answer
> 1 votes
You can include simple mathematical operators within EE conditionals so you could use something like this:

```
{exp:query sql="SELECT states FROM states"}
    {states}
    {if count < (total_results - 2)},
    {if:elseif count == (total_results - 1)} and
    {/if}
{/exp:query}

```

I have spread out the conditional to make it easier to read, but you might want to concatenate to avoid spurious linefeed / return characters appearing in your output.

HTH

---
Tags: string
---


title: Filter categories in dropdown

text:
# Question
Title: Filter categories in dropdown
On a Website i use two category groups: Wine (White, Red, Rose etc) and Food (Burgers, Fish, Seafood etc)

First page has a dropdown with categories of Wine

```
<form>
    <select>
    <option value="">Wine</option>
    {exp:channel:categories
        channel="product"
        category_group="1"
        show_empty="no"
        style="linear"}
        <option value="{path='pages/vintyp'}">{category_name}</option>
    {/exp:channel:categories}
    </select>
</form>

```

Linking to second page with categories of Food

```
<form>
    <select>
    <option value="">Food</option>
    {exp:channel:categories
        channel="product"
        category_group="2"
        show_empty="no"
        style="linear"}
        <option value="{path='pages/vintyp'}">{category_name}</option>
    {/exp:channel:categories}
    </select>
</form>

{exp:channel:entries channel="product" orderby="post_date" sort="desc"}
{/exp:channel:entries}

```

This will show all the used categories from the category group, but how do i filter out to only show those that correspond the selection of the previous category group?

If select “White” on the first page only “Seafood and Fish” should be in the dropdown on the second page If i select “Red” on the first page only “Burgers” should be in the dropdown.

Any help would be appreciated.

# Answer
The only way that you could achieve this would be to include something that describes the relationship between wine choices and food types somewhere in your model - unless EE can find out what food types are associated with a chosen wine type it is going to be difficult to get the mapping you desire to appear automatically.

Fortunately EE includes a couple of powerful tools for you to consider.

Introducing either idea into your site will require some thought about how you want to make use of and represent this relationship data.

Making a guess based on what you describe, probably the best route is to use relationships rather than categories - you could do this by creating two shadow channels (e.g. one called wines, one called food\_types) and set up a relationship field in wines that allows you to map food\_type channel entries to each wine entry. This might require some re-working of the logic in other parts of the site to work, but in long run probably will give you a more flexible solution.

HTH
> 1 votes

---
Tags: categories
---


# Question
Title: Auto populate Title field with current date
Is there a way to auto populate the Title field with current date? Basically Im wondering if the Title field can be auto- filled in with the current date when creating a new entry. EE 6

# Answer
> 0 votes
Install the free MX CP CSS & JS add-on and add the following code to the JS field in the settings of the add-on:

```
$(document).ready(function(){
    var currentDate = Date.now();
    var today = new Date(currentDate);
    var dateString = today.toLocaleDateString();
    var titleField = $('input[name="title"]');
    var url = $(location).attr('href');

    if(titleField.length && url.indexOf('/cp/publish/create/') > 0) {
        titleField.val(dateString  + " ");
    }
});

```

It will populate the title field with the current date with a trailing space.

---
Tags: date, title
---


# Question
Title: Unable to load ext.rte.php after updating from V2 to V6
After updating from version 2 to version 6, I get the following error when I want to edit an entry. Can anyone help me out?

```
Notice
Undefined index: extension

ee/legacy/libraries/Extensions.php, line 145

    Severity: E_NOTICE

Error
Unable to load the following extension file:
ext.rte.php

```

# Answer
> 1 votes
For the time being, the best solution would be manually remove record from `exp_extensions` DB table.

And of course, report a bug.

# Answer
> 0 votes
The error is caused by EE6 trying to load `ext.rte.php` which appears to be a built in module in EE2 used to provide access to the RTE preferences in the CP. The module continued to be used through until EE5, but was removed in EE6 (which is why EE6 cannot find it...).

For the error to occur, it seems likely that something has gone awry during your update. If you have the backup files available I would try re-running the migration; if the error occurs again on the second run through, it might be that something in your EE setup is confusing the updater, or a specific update problem for the EE6 updater. If that happens, probably the best course of action is to file a bug / issue within the EE github \- as it might be that a fix is needed to the updater code.

If you don't want to go down that route, the alternative would be to do your update in stages - there was a big change in EE between EE2 and EE3 - so start by doing just that jump, check that the migration went OK and if that works then go for the one-click update route through to EE6.

If you need copies of EE3-4-5 you can get them from the releases area on the EE github.

HTH.

---
Tags: extension, update
---


# Question
Title: significantly short term log out of the control panel
I am a super admin in a new EE6 install. The system has been logging me out every 5 minutes literally. Does anyone know how to resolve this issue?

# Answer
I would check your settings - go to the Control Panel and have a look at the Settings and see if the **URL and Path Settings** are correct. Then go to the Security & Privacy settings (near bottom of list on LHS)and see what **CP Session type** settings you have - change these to **Cookies Only** and check to see if the **Cookie Settings / Domain** setting has anything set - if it does clear the field. See if those changes make a difference.

HTH
> 0 votes

# Answer
It happened to me when I use Chrome With dev tools open AND mobile view
> 0 votes

---
Tags: logout
---


# Question
Title: What's the best, and fastest way, to remove large amounts of data from the database?
We need to remove large amounts of data (members, entries, etc) from the DB. What is the safest way to go about doing this? We're hoping we could run a delete query of sorts? Or that there is an extension that would help - but we've tried EE Support and searching around, with no real solution.

We have about 154807 members to remove; 1019974 entries to remove (for the entire channel); and 2143560 entries to remove from another (for the entire channel as well).

Unfortunately, we’ve been unable to remove these via the admin, it just freezes up and gives a time out error or memory limit error. Additionally, even trying to remove 500 at a time just for the channel entries (3163534 total entries) would mean having to do that over 6,000 times to get them all cleared out…

Essentially, this is a site that we had a cart system on for years, and need to remove all of that data, as they have migrated over to Magento for the cart, but are keeping the corporate site in EE.

UPDATE:

The current EE version is 5.4.1 The cart system we were using was CartThrob We also used the User module by EE Harbor to manage the members. Both CartThrob and User have been uninstalled.

# Answer
We ended up running similar queries found here Quick and safe way to delete all entries with a given status? and here Quickly delete 1000s of members

We were actually able to remove millions of rows of data using these queries, and so far there hasn't been any issue. We've removed members and channel entries. We went from 15 million rows of data down to about 7 in our first attempt, and have been able to remove 4 other custom channels since using these queries.

Here are the queries we ran:

---

## **Delete Channel Entries**

```
DELETE exp_channel_titles, exp_channel_data
FROM exp_channel_titles
INNER JOIN exp_channel_data
ON exp_channel_data.entry_id = exp_channel_titles.entry_id
WHERE exp_channel_titles.channel_id = XXX

```

---

## **Delete Members** \- skipping references to YYY, just in case\*

```
DELETE FROM `exp_members` WHERE `username` NOT LIKE '%YYY%' and `group_id` = XXX

```

**We didn't want to remove any test members we may have created, matching XXX domain, in this group.*
> 1 votes

---
Tags: channel-entries, members, database
---


# Question
Title: How to use a remote database inside docker containers
I'm attempting to setup a docker container to run expression engine. Using best practices for Docker, it is recommended to separate the db from the web host and php containers. However, it seems there is no easy way to specify a remote database that I can find. The admin.php wizard always fails to connect to the database.

* I am using mysql 5.6 currently
* I have a hostname (db) that connects to the SQL container correctly via telnet from php and web containers, so I know its available.
* Setting the server address to db or its ip address fails to connect
* I have even tried a stream rewrite in nginx to pass all data from localhost:3306 to db:3306 with no luck. Tested by telnetting to localhost:3306 from php and web containers.

Does anyone have the correct procedure to tweak the database hostname before running the wizard with admin.php?

Thanks!

# Answer
> 2 votes
Figured it out.

```
FROM php:fpm-alpine

```

Doesn't include the mysql mods. I had to add this line to my dockerfile for php container:

```
RUN docker-php-ext-install mysqli pdo pdo_mysql

```

# Answer
> 0 votes
Managed Cloud Hosting Platform Focus on your business and avoid all the web hosting hassles. Our managed hosting guarantees unmatched performance, reliability and choice with 24/7 support that acts as your extended team, making Cloudways an ultimate choice for growing agencies and ecommerce businesses. this is the link https://www.cloudways.com/en/?id=859025

---
Tags: database, config
---


title: Transcribe addon multi language bug

text:
# Question
Title: Transcribe addon multi language bug
I am using ExpressionEngine-5.4.0 with Transcribe v3.6 & Structure v4.7

In my site there is 3 languages (Azerbaijani, English, Russian)

And this is my settings for per language

* Azerbaijani: no prefix, default language
* English: /en/ prefix
* Russian: /ru/ prefix

Homepage urls:

* /en/welcome (EN Home)
* /ru/welcome (RU Home)
* /xos-gelmisiniz (AZ Home)

If the user's on site language is en or ru and if he types /xos-gelmisiniz to bar ExpressionEngine returns 404 page.

**However**

If user types /az/xos-gelmisiz on browser bar will work. Doesn't matter what language was on that time.

How can I fix that? Thanks.

# Answer
These sound like issues that are specific to Structure and Transcribe rather than EE itself; have you tried asking for support from eeharbour / packettide (who are authors of both add-ons)?
> 0 votes

---
Tags: structure, transcribe, multi-language
---


title: Updating hooks from v2 to v4

text:
# Question
Title: Updating hooks from v2 to v4
My company has a legacy add-on from version 2 and has now updated to version 4 of EE. With the upgrade, the hooks that fire when a new entry of a specific channel type are no longer triggering.

After some research, it looks like the issue that the hook names are wrong. The code defining them is below.

```
   public function activate_extension() {

       // Setup custom settings in this array.
       $this->settings = array();

       $entrySubmissionBeginHook = array(
           'class'     => __CLASS__,
           'method'    => 'entrySubmissionBegin',
           'hook'      => 'entry_submission_ready',
           'settings'  => serialize($this->settings),
           'version'   => $this->version,
           'enabled'   => 'y'
       );

       $entrySubmissionEndHook = array(
           'class'     => __CLASS__,
           'method'    => 'entrySubmissionEnd',
           'hook'      => 'entry_submission_end',
           'settings'  => serialize($this->settings),
           'version'   => $this->version,
           'enabled'   => 'y'
       );

       $deleteEntriesStarthook = array(
           'class'     => __CLASS__,
           'method'    => 'deleteEntriesStart',
           'hook'      => 'delete_entries_start',
           'settings'  => serialize($this->settings),
           'version'   => $this->version,
           'enabled'   => 'y'
       );

       ee()->db->insert('extensions', $entrySubmissionBeginHook);
       ee()->db->insert('extensions', $entrySubmissionEndHook);
       ee()->db->insert('extensions', $deleteEntriesStarthook);
   }

```

# Answer
There were certainly several extension hook changes with the arrival of EE3, possibly with EE4 too, so you may well need to update the naming of the hooks in your addon.

You can find a complete list of the hooks available in EE 4 in the documentation.

HTH
> 2 votes

---
Tags: add-on-development, extension, hook
---


title: Listen to events fired by hook EE4

text:
# Question
Title: Listen to events fired by hook EE4
I have an object that needs to be notified when a hook function is called, and act on the data from the hook?

# Answer
> 0 votes
Probably the thing to do is create another extension that listens for the same hook and give it a sufficiently high priority such that it fires last (or perhaps immediately following the instance of the hook you are interested in if the hook is likely to be called multiple times).

Within your new extension you can then retrieve the data from the previous use of the hook using the variable `$this->extensions->last_call`.

More on this in the documentation for EE4 here.

HTH

---
Tags: hook
---


# Question
Title: Allow PHP? not working in Expression Engine 2.11 templates
Has anyone experienced before having issues with the Allow PHP? option in the Templates not working?

Suddenly, the server stopped recognizing the PHP code and it is now not able to show anything nor using custom PHP code in there.

Any help would be truly appreciated.

Thanks!

# Answer
> 1 votes
I have not come across this behaviour myself - when things suddenly appear on otherwise stable systems usually the system itself is not the cause - if you have not changed the site code or the add-on code it is unclear why it would stop working.

I would check to see if there has (for example) been a change in your server environment - such as a change in php version being run? There have been a few examples of such bumps in php level triggering problems with add-ons (and EE).

HTH

---
Tags: php, php-errors, ee2.11
---


title: Will EE 3.x work with PHP 5.6+

text:
# Question
Title: Will EE 3.x work with PHP 5.6+
I am running a site on EE 3.5.17 and I am trying to determine which version of PHP I can use without causing issue or conflicts with existing plugins, which includes CartThrob 3.2. The EE documentation says the following is required for EE 3.x:

> PHP 5.3.10 can also be read as five-point-three-point-ten. That means 5.3.10 is greater than 5.3.1, 5.3.2, 5.3.3, and all the way up to 5.3.9.

I am currently running PHP 5.4 for the site but would like to move to 5.6.4 or greater given the EOL issues.

I would appreciate perspective from the community. Thanks.

# Answer
The short answer is yes. The documentation indicates that the minimum version is 5.3.10 but EE3 will work with php versions up to 7.2 depending upon which EE3 you install: php 7 compatability was included in EE3.1 HTH
> 2 votes

---
Tags: cartthrob, php, upgrade, php7
---


# Question
Title: .htaccess redirect for new template group name
I had to change a template group name for a blog channel from news-and-blog to news-and-forum. I am trying to create a redirect in .htaccess that would redirect the old URL along with any of the blog posts.

The redirect I created works but it is redirecting all of the channel entries to the index page instead of just changing the first segment.

For example, the old URL https://mywebsite.com/news-and-blog correctly redirects to https://mywebsite.com/news-and-forum, but https://mywebsite.com/news-and-blog/my-blog-entry also gets redirected to https://mywebsite.com/news-and-forum. I need it to redirect to https://mywebsite.com/news-and-forum/my-blog-entry

Here is my .htaccess code:

```
    RewriteEngine On

    RewriteRule ^news-and-blog/(.*)$ /news-and-forum/$1 [L,R=301,NC]

    # Redirects to https & www
    RewriteCond %{HTTPS} off
    RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    # Removes index.php
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php?/$1 [L]
</IfModule>

```

I have also tried changing the order of the rewrite rule but always get the same result. And I have tried it with & without the https & www redirect.

Any insight is appreciated.

# Answer
There is nothing wrong with your additional `RewriteRule` \- a version of it works just fine on my test system.

You don't say which version of EE you are using, but the latest recommended .htaccess file is a bit different to the one you are using.

The various forms of .htaccess file are documented here; the suggestion is something like this

```
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    # Removes index.php from ExpressionEngine URLs
    RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
    RewriteCond %{REQUEST_URI} !/system/.* [NC]
    RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

    # Directs all EE web requests through the site index file
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

```

Adding in your additional code ends up with something like this:

```
 <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteRule ^news-and-blog/(.*)$ /news-and-forum/$1 [NC,R=301,L]

    # Redirect to https
    RewriteCond %{HTTPS} off
    RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

    # Force use of www prefix
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

    # Remove index.php from ExpressionEngine URLs
    RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
    RewriteCond %{REQUEST_URI} !/system/.* [NC]
    RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

    # Direct all EE web requests through the site index file
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

```

Might be worth trying that to see if works any better.

HTH
> 1 votes

---
Tags: htaccess
---


title: Convert old (EE2) addon to EE6

text:
# Question
Title: Convert old (EE2) addon to EE6
wondering if anyone can help me convert this to EE6. Thanks

```
<?php

/**
* @package ExpressionEngine
* @author Wouter Vervloet
* @copyright  Copyright (c) 2010, Baseworks
* @license    http://creativecommons.org/licenses/by-sa/3.0/
*
* This work is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported.
* To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/
* or send a letter to Creative Commons, 171 Second Street, Suite 300,
* San Francisco, California, 94105, USA.
*
*/

if ( ! defined('EXT')) { exit('Invalid file request'); }

class Royal_titles
{
  public $settings            = array();

  public $name                = 'Royal Titles';
  public $version             = 0.6;
  public $description         = "Enable EE global variables for the default weblog title setting.";
  public $settings_exist      = 'n';
  public $docs_url            = '';

    // -------------------------------
    // Constructor
    // -------------------------------
    function Royal_titles($settings='')
    {
      $this->__construct($settings);
    }

    function __construct($settings='')
    {
        $this->settings = $settings;
    }
    // END Super_titles

    function parse_preferences($data = array())
    {

      global $LOC, $PREFS;

      $val = $data['default_entry_title'];

      if( ! $val ) return $data;

      foreach($data as $key => $var)
        {
            $val = str_replace(LD.$key.RD, $var, $val);
        }

        if (strpos($val, LD.'current_time') !== FALSE && preg_match_all("/".LD."current_time\s+format=([\"\'])([^\\1]*?)\\1".RD."/", $val, $matches))
        {
        for ($j = 0; $j < count($matches['0']); $j++)
        {
            $val = preg_replace("/".preg_quote($matches['0'][$j], '/')."/", $LOC->decode_date($matches['2'][$j], $LOC->now), $val, 1);
        }
      }

      $data['default_entry_title'] = $val;

      return $data;
    }

    // --------------------------------
    //  Activate Extension
    // --------------------------------
    function activate_extension()
    {

      global $DB;

    $sql = array();

    // hooks array
    $hooks = array(
      'publish_form_weblog_preferences' => 'parse_preferences'
    );

    // insert hooks and methods
    foreach ($hooks AS $hook => $method)
    {
      // data to insert
      $data = array(
        'class'     => get_class($this),
        'method'    => $method,
        'hook'      => $hook,
        'priority'  => 1,
        'version'   => $this->version,
        'enabled'   => 'y',
        'settings'  => ''
      );

      // insert in database
      $sql[] = $DB->insert_string('exp_extensions', $data);
    }

    // run all sql queries
    foreach ($sql as $query) {
      $DB->query($query);
    }

    return true;
    }
    // END activate_extension

    // --------------------------------
    //  Update Extension
    // --------------------------------
    function update_extension($current='')
    {
      global $DB;

    if ($current == '' OR $current == $this->version)
    {
      return FALSE;
    }

    if($current < $this->version) { }

    // init data array
    $data = array();

    // Add version to data array
    $data['version'] = $this->version;

    // Update records using data array
    $sql = $DB->update_string('exp_extensions', $data, "class = '".get_class($this)."'");
    $DB->query($sql);
  }
  // END update_extension

    // --------------------------------
    //  Disable Extension
    // --------------------------------
    function disable_extension()
    {
      global $DB;

    // Delete records
    $DB->query("DELETE FROM exp_extensions WHERE class = '".get_class($this)."'");
  }
  // END disable_extension

}
// END CLASS

```

# Answer
> 0 votes
For EE6 add-on, this "addon.setup.php" file must be created.

So please add this "addon.setup.php" below file in the 'system/user/addons/royal\_titles'.

> addon.setup.php

```
<?php
require PATH_THIRD.'royal_titles/config.php';
return array(
    'author'      => '',
    'author_url'  => '',
    'name'        => BW_RT_NAME,
    'description' => BW_RT_DESCRIPTION,
    'version'     => BW_RT_VERSION,
    'namespace'   => 'RT\Addons\RoyalTitles',
    'docs_url'    => BW_RT_DOCUMENTATION,
    'settings_exist' => FALSE
);

```

For ee6, we have changed some code in the 'ext.royal\_titles.php' file

> ext.royal\_titles.php

```
<?php
/**
* @package ExpressionEngine
* @author Wouter Vervloet
* @copyright  Copyright (c) 2010, Baseworks
* @license    http://creativecommons.org/licenses/by-sa/3.0/
*
* This work is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported.
* To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/
* or send a letter to Creative Commons, 171 Second Street, Suite 300,
* San Francisco, California, 94105, USA.
*
*/

require PATH_THIRD.'royal_titles/config.php';

class Royal_titles_ext
{
  public $settings            = array();

  public $name                = 'Royal Titles';
  public $version             = 0.6;
  public $description         = "Enable EE global variables for the default weblog title setting.";
  public $settings_exist      = 'n';
  public $docs_url            = '';

    // -------------------------------
    // Constructor
    // -------------------------------
    function Royal_titles($settings='')
    {
      $this->__construct($settings);
    }

    function __construct($settings='')
    {
        $this->settings = $settings;
    }
    // END Super_titles

    function parse_preferences($data = array())
    {

      global $LOC, $PREFS;

      $val = $data['default_entry_title'];

      if( ! $val ) return $data;

      foreach($data as $key => $var)
        {
            $val = str_replace(LD.$key.RD, $var, $val);
        }

        if (strpos($val, LD.'current_time') !== FALSE && preg_match_all("/".LD."current_time\s+format=([\"\'])([^\\1]*?)\\1".RD."/", $val, $matches))
        {
        for ($j = 0; $j < count($matches['0']); $j++)
        {
            $val = preg_replace("/".preg_quote($matches['0'][$j], '/')."/", $LOC->decode_date($matches['2'][$j], $LOC->now), $val, 1);
        }
      }

      $data['default_entry_title'] = $val;

      return $data;
    }

    // --------------------------------
    //  Activate Extension
    // --------------------------------
    function activate_extension()
    {

      global $DB;

    $sql = array();

    // hooks array
    $hooks = array(
      'publish_form_weblog_preferences' => 'parse_preferences'
    );

    // insert hooks and methods
    foreach ($hooks AS $hook => $method)
    {
      // data to insert
      $data = array(
        'class'     => get_class($this),
        'method'    => $method,
        'hook'      => $hook,
        'priority'  => 1,
        'version'   => $this->version,
        'enabled'   => 'y',
        'settings'  => ''
      );

      // insert in database
      $sql[] = ee()->db->insert_string('exp_extensions', $data);
    }

    // run all sql queries
    foreach ($sql as $query) {
      ee()->db->query($query);
    }

    return true;
    }
    // END activate_extension

    // --------------------------------
    //  Update Extension
    // --------------------------------
    function update_extension($current='')
    {
      global $DB;

    if ($current == '' OR $current == $this->version)
    {
      return FALSE;
    }

    if($current < $this->version) { }

    // init data array
    $data = array();

    // Add version to data array
    $data['version'] = $this->version;

    // Update records using data array
    $sql = ee()->db->update_string('exp_extensions', $data, "class = '".get_class($this)."'");
    ee()->db->query($sql);
  }
  // END update_extension

    // --------------------------------
    //  Disable Extension
    // --------------------------------
    function disable_extension()
    {
      global $DB;

    // Delete records
    ee()->db->query("DELETE FROM exp_extensions WHERE class = '".get_class($this)."'");
  }
  // END disable_extension

}
// END CLASS

```

If your addon also have the 'config.php' file at this location "system/user/addons/royal\_titles".

> config.php

```
<?php

if ( ! defined('BW_RT_VERSION'))
{
  define('BW_RT_VERSION', '0.6');
  define('BW_RT_NAME', 'Royal Titles');
  define('BW_RT_DESCRIPTION', 'Enable EE global variables for the default weblog title setting.');
  define('BW_RT_DOCUMENTATION', 'http://support.baseworks.nl/discussions/royal_titles');
  define('BW_RT_DEBUG', FALSE);
}

$config['name'] = BW_RT_NAME;
$config['version'] = BW_RT_VERSION;
$config['description'] = BW_RT_DESCRIPTION;
$config['nsm_addon_updater']['versions_xml'] = '';

```

We have tested this add-on and it is working properly with install and uninstall process on EE6. Please test your functionality of this add-on. If you still get any error then please let us know. We will recheck this script and solve it.

---
Tags: add-on-development
---


title: Cartthrob extload.php error 403

text:
# Question
Title: Cartthrob extload.php error 403
I have an old store EE 2.5.3, CT 2.2.9 - implementation from 2012. A week ago, I get this message overnight when returning from the payment gateway to the cartthrob store. \[403\] Forbidden /themes/third\_party/cartthrob/lib/extload.php/przelewy24/success. Has anyone encountered this? Maybe the server settings have been changed? The extload.php file has 755 permissions. I would appreciate any help.

# Answer
> 0 votes
Apologize. Jelle is right. The hosting company changed security settings without notifying. Fortunately, we managed to turn it off.

---
Tags: cartthrob, error
---


# Question
Title: Dynamic driven open tags preventing posting a tweet
We're using open tags in layouts to dynamically drive Twitter and FB previews.

```
{layout:set name="og-tags"}
<meta name="description" content="{intro}" />
<meta name="keywords" content="Remote Learning, Online Learning, Faculty Online Guidance, UMass Boston" />
<meta name="twitter:card" content="{banner}{url}{/banner}" />
<meta name="twitter:title" content="{title}" />
<meta name="twitter:site" content="@umbelearning" />
<meta property="og:url" content="{url_title_path}" />
<meta property="og:title" content="{title}" />
<meta property="og:description" content="{intro}" />
<meta property="og:image" content="{banner}{url}{/banner}" />

{/layout:set}

```

The previews not working on twitter (fine on FB). Page source shows tags rendering image but not displaying. ex) https://teachonline.umb.edu/course-design, https://teachonline.umb.edu/assessment etc. And only homepage even shows the card preview. \[see attached\]

# Answer
> 1 votes
Solution: This syntax is incorrect: `<meta name="twitter:card" content="{banner}{url}{/banner}">` It should be `<meta name="twitter:card" content="summary_large_image" />` Used this debugger site -\> https://cards-dev.twitter.com/validator

# Answer
> 0 votes
Please remove the "/" slash before the ending meta tag.

Check below code.

```
...
<meta name="twitter:card" content="{banner}{url}{/banner}">
<meta name="twitter:title" content="{title}">
<meta name="twitter:site" content="@umbelearning">
...

```

---
Tags: twitter
---


title: What is a valid sender email?

text:
# Question
Title: What is a valid sender email?
I am setting up a new site using EE 6 and I am having issues with the form. I have set the Outgoing email settings and have a valid email.

Here is the form:

```
{exp:email:contact_form user_recipients="no" class=" bg-light-blue mx-auto" recipients="admin@example.com" charset="utf-8"}
   <div class="form-header bg-blue pt-2">
        <p class="white-text text-center" style="font-size: 1.5rem; margin-top: .2rem;">Get a free estimate</p>
    </div>
    <p>
        <label for="from"></label><br />
        <input type="text" id="from" name="from" placeholder="Name*"  value="" />
    </p>
    <p>
        <label for="email"></label><br />
        <input type="text" id="email" name="email" placeholder="Email*" value="" />
    </p>
    <p>
        <label for="phone"></label><br />
        <input type="text" id="phone" name="phone" placeholder="Phone" value="" />
    </p>
    <p>
        <label for="message"></label><br />
        <textarea id="message" name="message" class="pt-2 px-2" id="comments" placeholder="Tell us about your project, ask questions and let us know when you would be available to discuss your project and get a free estimate of the cost."></textarea>
    </p>
    <p>
        <input name="submit" type='submit' value='Submit Form' />
    </p>
{/exp:email:contact_form}

```

I have tried PHP, Sendmail and SMTP but keep getting the following error:

> A valid sender email is required

I am not sure what I am doing wrong on this.

Thanks.

# Answer
> 1 votes
You can test your email settings from within the EE6 Control Panel.

Go to Tools/Utilities/Send Email and you get a form that allows you to send an email from the EE installation to an arbitrary email address.

Try to send yourself an email from there. If that doesn't work then the issue is with your outgoing email settings, not your form.

I think also you have a problem with the names of input fields in your form. If you check the documentation you'll see:

* The field for the email address of person filling in form should be named **from** (not **email**)
* The field for the name of the person filling in the form should be named **name** (not **from**)

HTH

# Answer
> 1 votes
jCogs is correct. your Email input name="" attribute needs to be "from". So:

```
<label for="email"></label><br />
<input type="text" id="email" name="from" placeholder="Email*" value="" />

```

---
Tags: email, ee
---


# Question
Title: Is there a plugin or setting in EE6 that can randomize filename of uploaded files?
I'm looking for a way to randomize filename of uploaded files. I've noticed in the documentation; specifically in the Legacy Reference -\> File Upload Class there is a preference setting for encrypting filename.

A bit surprised there is no setting for this feature out of the box.

# Answer
There's Low Random, which is probably what you're looking for
> 0 votes

---
Tags: file-uploads, ee
---


title: Strange google links question

text:
# Question
Title: Strange google links question
I'm getting tons of bogus links to my EE site (ee6) when I search on Google, as in, I can see this link in google:

"https://www.andy-kirkpatrick.com/blog/view/the-haunted-cliff"

which is correct, but also this one (and many others), like this:

"https://www.andy-kirkpatrick.com/articles/view/the-haunted-cliff"

which goes to a 404 page.

There is no way that post should appear in that view template, and it does not appear in my sitemap either. I'm also getting results for

template paths for templates that I have never created on the site.

Any ideas?

Best

Andy

# Answer
I've seen that very occasionally but never found an reason as to why it happens.

Possible causes:

1. Was the URL /articles previously use before?
2. Are any external sites linking to URL's that contain /articles?
3. Have you got any (or had you ever had) internal links that point to /articles that may be crawled by search engines?
4. Does it only happen on Google or are other engines that same?
> 0 votes

---
Tags: search, error, google
---


title: Assets and s3 Expression Engine 2

text:
# Question
Title: Assets and s3 Expression Engine 2
We run a really old website on EE2.... we're not in a position to upgrade for various reasons.

I've just come to hookup s3 with the Assets module and when putting the secret id and access key and searching for the bucket it gives me a php error. It does find the bucket name etc.

Can anyone identify how I can overcome this?

# Answer
> 0 votes
It looks very much like S3's security model has tightened since your copy of Assets was written. This presumably has been fixed in more recent versions of Assets (as S3 access is listed as a feature of the app still).

The latest version of Assets is 3.4.5 which is described as being compatible with EE2 - so it looks like the easiest / best solution to your problem is to update your copy of Assets.

HTH

# Answer
> 0 votes
You can check the below post. https://stackoverflow.com/questions/26533245/the-authorization-mechanism-you-have-provided-is-not-supported-please-use-aws4 This post have the same issue. This post will be help you to update the code in the add-on.

---
Tags: ee2, assets, s3, 2.8, amazons3
---


# Question
Title: Dropdown menus in RTE H tags render 1 level higher i.e. h2 tags render as h3
My university cannot allow for H1 tags in the RTE as we have to hold that important ADA tag for the page titles. There may have been a config somewhere in the affected EE6 install (developers tied up with priorities) b/c the solution was to keep an h1-h3 dropdown but render as follows: h1 as h2, h3 as h4 and h4 as h6. I only have 3 options. I'd like to at least a 4th option (h4 which would then render as h5). Where in the system can i add this?

# Answer
There is no proper way to add this setting. But we have to add some extra code to the ckeditor.js file.

You have to add the code as per the below screenshot.

Updated code for that part:

```
 constructor(t) {
            super(t), t.config.define("heading", {
                options: [{
                    model: "paragraph",
                    title: "Paragraph",
                    class: "ck-heading_paragraph"
                }, {
                    model: "heading1",
                    view: "h2",
                    title: "Heading 1",
                    class: "ck-heading_heading1"
                }, {
                    model: "heading2",
                    view: "h3",
                    title: "Heading 2",
                    class: "ck-heading_heading2"
                }, {
                    model: "heading3",
                    view: "h4",
                    title: "Heading 3",
                    class: "ck-heading_heading3"
                }, {
                    model: "heading4",
                    view: "h5",
                    title: "Heading 4",
                    class: "ck-heading_heading4"
                }]
            })
        }

```
> 0 votes

---
Tags: rte, headers
---


# Question
Title: Addon development - make visible to Member permissions?
Using EE 3.5.1.

I have made a simple extension to allow a logged in user manage a single `settings()` text field. However, I cannot grant access to this add-on to other Member Groups because it does not appear in the list of addons in the 'Allowed add-on access' list.

How do I get my addon in this list? I have heard I need to make it into a Module, but Modules don't appear to be able to use the built-in `settings()` function: I get a 404 if I put it in the MCP file so I'm not sure what I'm meant to do.

If anyone other than a Super Admin tries to access the settings page they just get `Error: You are not authorized to access this page`

# Answer
You have to create as module to display your add-on into the list of the "Allowed add-on access". You can just echo 'This is just extension.' in the index function of the MCP file of your add-on.
> 0 votes

---
Tags: add-on-development, module, settings
---