title: DB Error after Playa upgrade in EE2.10

text:
# Question
Title: DB Error after Playa upgrade in EE2.10
I had an error after upgrading and fixed is as suggested in right here.

In this thread, the issue seems fixed, but for me, not just yet. Now I've got a similar, but not the same, error:

```
Error Number: 1060

Duplicate column name 'parent_element_id'

ALTER TABLE exp_playa_relationships ADD parent_element_id VARCHAR(255) NULL AFTER parent_var_id

Filename: third_party/playa/ft.playa.php

Line Number: 488

```

# Answer
> 0 votes
As they mentioned in the thread, there's a certain amount of things to be checked. If this then, that.

In my case, I had to check if there's a parent\_element\_id in exp\_playa\_relationships and, if so, change version to 4.5.2 in exp\_fieldtypes.

These checks do feel somewhat more complex though, as you can just change the version to whatever version you're trying to install (which you can see in the Add-Ons -\> Fieldtype tab)

---
Tags: playa, pixelandtonic, error, upgrade, ee2-upgrades
---


title: Mustash Cache breaking rules

text:
# Question
Title: Mustash Cache breaking rules
When I try saving Cache breaking rules with Mustash, I get this error:

```
Error Number: 1366

Incorrect integer value: 'NULL' for column 'group_id' at row 1

INSERT INTO `exp_stash_rules` (`plugin`, `hook`, `group_id`, `bundle_id`, `scope`, `pattern`, `ord`, `site_id`) VALUES ('channel_entries', '@all', 'NULL', 'NULL', 'NULL', '', 0, '2')

Filename: third_party/mustash/models/mustash_model.php

Line Number: 574

```

Any thoughts on this?

We're using a Multi-Site Manager setup.

# Answer
> 1 votes
The developer gave a solution here: https://devot-ee.com/add-ons/support/mustash/viewthread/15161

Change the following code on line line 664 in mcp.mustash.php:

```
'group_id' => $group[$index],

```

To:

```
'group_id' => ($group[$index] == "NULL" ? NULL : $group[$index]),

```

---
Tags: stash, database-error, mustash
---


# Question
Title: FreeForm installation Error - Table 'DATABASE.exp_freeform_fieldtypes' doesn't exist
When trying to install either FreeForm Lite OR FreeForm Pro version 4.2.3, the following database error occurs, making it impossible to install the plugin.

There are no references to any tables within the database so it's trying to delete something which doesn't exist and failing.

ExpressionEngine version 2.10.1

```
A Database Error Occurred
Error Number: 1146

Table 'staging_camden_brewery.exp_freeform_fieldtypes' doesn't exist

DELETE FROM `exp_freeform_fieldtypes` WHERE `default_field` = 'y'

Filename: third_party/freeform/models/freeform_model.php

Line Number: 538

```

# Answer
I managed to get it working by opening up and running the SQL commands inside **db.freeform.sql** one by one. Then installing once all the tables were in the database:

```
CREATE TABLE IF NOT EXISTS `exp_freeform_forms` (
    `form_id`                       int(10) unsigned    NOT NULL AUTO_INCREMENT,
    `site_id`                       int(10) unsigned    NOT NULL DEFAULT 1,
    `form_name`                     varchar(150)        NOT NULL DEFAULT 'default',
    `form_label`                    varchar(150)        NOT NULL DEFAULT 'default',
    `default_status`                varchar(150)        NOT NULL DEFAULT 'default',
    `notify_user`                   char(1)             NOT NULL DEFAULT 'n',
    `notify_admin`                  char(1)             NOT NULL DEFAULT 'n',
    `user_email_field`              varchar(150)        NOT NULL DEFAULT '',
    `user_notification_id`          int(10) unsigned    NOT NULL DEFAULT 0,
    `admin_notification_id`         int(10) unsigned    NOT NULL DEFAULT 0,
    `admin_notification_email`      text,
    `form_description`              text,
    `field_ids`                     text,
    `field_order`                   text,
    `template_id`                   int(10) unsigned    NOT NULL DEFAULT 0,
    `composer_id`                   int(10) unsigned    NOT NULL DEFAULT 0,
    `author_id`                     int(10) unsigned    NOT NULL DEFAULT 0,
    `entry_date`                    int(10) unsigned    NOT NULL DEFAULT 0,
    `edit_date`                     int(10) unsigned    NOT NULL DEFAULT 0,
    `settings`                      text,
    PRIMARY KEY                     (`form_id`),
    KEY                             (`form_name`),
    KEY                             (`site_id`)
) CHARACTER SET utf8 COLLATE utf8_general_ci ;;

CREATE TABLE IF NOT EXISTS `exp_freeform_composer_layouts` (
    `composer_id`                   int(10) unsigned    NOT NULL AUTO_INCREMENT,
    `composer_data`                 text,
    `site_id`                       int(10) unsigned    NOT NULL DEFAULT 1,
    `preview`                       char(1)             NOT NULL DEFAULT 'n',
    `entry_date`                    int(10) unsigned    NOT NULL DEFAULT 0,
    `edit_date`                     int(10) unsigned    NOT NULL DEFAULT 0,
    PRIMARY KEY                     (`composer_id`),
    KEY                             (`preview`)
) CHARACTER SET utf8 COLLATE utf8_general_ci ;;

CREATE TABLE IF NOT EXISTS `exp_freeform_fields` (
    `field_id`                      int(10) unsigned    NOT NULL AUTO_INCREMENT,
    `site_id`                       int(10) unsigned    NOT NULL DEFAULT 1,
    `field_name`                    varchar(150)        NOT NULL DEFAULT 'default',
    `field_label`                   varchar(150)        NOT NULL DEFAULT 'default',
    `field_type`                    varchar(50)         NOT NULL DEFAULT 'text',
    `settings`                      text,
    `author_id`                     int(10) unsigned    NOT NULL DEFAULT 0,
    `entry_date`                    int(10) unsigned    NOT NULL DEFAULT 0,
    `edit_date`                     int(10) unsigned    NOT NULL DEFAULT 0,
    `required`                      char(1)             NOT NULL DEFAULT 'n',
    `submissions_page`              char(1)             NOT NULL DEFAULT 'y',
    `moderation_page`               char(1)             NOT NULL DEFAULT 'y',
    `composer_use`                  char(1)             NOT NULL DEFAULT 'y',
    `field_description`             text,
    PRIMARY KEY                     (`field_id`),
    KEY                             (`field_name`),
    KEY                             (`site_id`)
) CHARACTER SET utf8 COLLATE utf8_general_ci ;;

CREATE TABLE IF NOT EXISTS `exp_freeform_fieldtypes` (
    `fieldtype_id`                  int(10) unsigned    NOT NULL AUTO_INCREMENT,
    `fieldtype_name`                varchar(250),
    `settings`                      text,
    `default_field`                 char(1)             NOT NULL DEFAULT 'n',
    `version`                       varchar(12),
    PRIMARY KEY                     (`fieldtype_id`),
    KEY                             (`fieldtype_name`)
) CHARACTER SET utf8 COLLATE utf8_general_ci ;;

CREATE TABLE IF NOT EXISTS `exp_freeform_composer_templates` (
    `template_id`                   int(10) unsigned    NOT NULL AUTO_INCREMENT,
    `site_id`                       int(10) unsigned    NOT NULL DEFAULT 1,
    `template_name`                 varchar(150)        NOT NULL DEFAULT 'default',
    `template_label`                varchar(150)        NOT NULL DEFAULT 'default',
    `template_description`          text,
    `enable_template`               char(1)             NOT NULL DEFAULT 'y',
    `template_data`                 text,
    `param_data`                    text,
    PRIMARY KEY                     (`template_id`),
    KEY                             (`template_name`)
) CHARACTER SET utf8 COLLATE utf8_general_ci ;;

CREATE TABLE IF NOT EXISTS `exp_freeform_notification_templates` (
    `notification_id`               int(10) unsigned    NOT NULL AUTO_INCREMENT,
    `site_id`                       int(10) unsigned    NOT NULL DEFAULT 1,
    `notification_name`             varchar(150)        NOT NULL DEFAULT 'default',
    `notification_label`            varchar(150)        NOT NULL DEFAULT 'default',
    `notification_description`      text,
    `wordwrap`                      char(1)             NOT NULL DEFAULT 'y',
    `allow_html`                    char(1)             NOT NULL DEFAULT 'n',
    `from_name`                     varchar(150)        NOT NULL DEFAULT '',
    `from_email`                    varchar(250)        NOT NULL DEFAULT '',
    `reply_to_email`                varchar(250)        NOT NULL DEFAULT '',
    `email_subject`                 varchar(128)        NOT NULL DEFAULT 'default',
    `include_attachments`           char(1)             NOT NULL DEFAULT 'n',
    `template_data`                 text,
    PRIMARY KEY                     (`notification_id`),
    KEY                             (`notification_name`)
) CHARACTER SET utf8 COLLATE utf8_general_ci ;;

CREATE TABLE IF NOT EXISTS `exp_freeform_params` (
    `params_id`                     int(10) unsigned    NOT NULL AUTO_INCREMENT,
    `entry_date`                    int(10) unsigned    NOT NULL DEFAULT 0,
    `data`                          text,
    PRIMARY KEY                     (`params_id`),
    KEY                             (`entry_date`)
) CHARACTER SET utf8 COLLATE utf8_general_ci ;;

CREATE TABLE IF NOT EXISTS `exp_freeform_preferences` (
    `preference_id`                 int(10) unsigned    NOT NULL AUTO_INCREMENT,
    `preference_name`               varchar(80),
    `preference_value`              text,
    `site_id`                       int(10) unsigned    NOT NULL DEFAULT 1,
    PRIMARY KEY                     (`preference_id`),
    KEY                             (`preference_name`)
) CHARACTER SET utf8 COLLATE utf8_general_ci ;;

CREATE TABLE IF NOT EXISTS `exp_freeform_user_email` (
    `email_id`                      int(10) unsigned    NOT NULL AUTO_INCREMENT,
    `site_id`                       int(10) unsigned    NOT NULL DEFAULT 1,
    `author_id`                     int(10) unsigned    NOT NULL DEFAULT 0,
    `ip_address`                    varchar(40)         NOT NULL DEFAULT 0,
    `entry_date`                    int(10) unsigned    NOT NULL DEFAULT 0,
    `form_id`                       int(10) unsigned    NOT NULL DEFAULT 0,
    `entry_id`                      int(10) unsigned    NOT NULL DEFAULT 0,
    `email_count`                   int(10) unsigned    NOT NULL DEFAULT 0,
    `email_addresses`               text,
    PRIMARY KEY                     (`email_id`),
    KEY                             (`ip_address`)
) CHARACTER SET utf8 COLLATE utf8_general_ci;;

CREATE TABLE IF NOT EXISTS `exp_freeform_file_uploads` (
    `file_id`                       int(10) unsigned    NOT NULL AUTO_INCREMENT,
    `site_id`                       int(10) unsigned    NOT NULL DEFAULT 1,
    `form_id`                       int(10) unsigned    NOT NULL DEFAULT 0,
    `entry_id`                      int(10) unsigned    NOT NULL DEFAULT 0,
    `field_id`                      int(10) unsigned    NOT NULL DEFAULT 0,
    `server_path`                   varchar(750),
    `filename`                      varchar(250),
    `extension`                     varchar(20),
    `filesize`                      int(10)             NOT NULL DEFAULT 0,
    PRIMARY KEY                     (`file_id`),
    KEY                             (`entry_id`),
    KEY                             (`field_id`),
    KEY                             (`extension`)
) CHARACTER SET utf8 COLLATE utf8_general_ci ;;

CREATE TABLE IF NOT EXISTS `exp_freeform_multipage_hashes` (
    `hash_id`                       int(10) unsigned    NOT NULL AUTO_INCREMENT,
    `site_id`                       int(10) unsigned    NOT NULL DEFAULT 1,
    `form_id`                       int(10) unsigned    NOT NULL DEFAULT 0,
    `entry_id`                      int(10) unsigned    NOT NULL DEFAULT 0,
    `hash`                          varchar(32)         NOT NULL DEFAULT '',
    `ip_address`                    varchar(40)         NOT NULL DEFAULT 0,
    `date`                          int(10) unsigned    NOT NULL DEFAULT 0,
    `edit`                          char(1)             NOT NULL DEFAULT 'n',
    `data`                          text,
    PRIMARY KEY                     (`hash_id`),
    KEY                             (`hash`),
    KEY                             (`ip_address`),
    KEY                             (`site_id`)
) CHARACTER SET utf8 COLLATE utf8_general_ci;;

CREATE TABLE IF NOT EXISTS `exp_freeform_email_logs` (
    `id`                            int(10) unsigned    NOT NULL AUTO_INCREMENT,
    `site_id`                       int(10) unsigned    NOT NULL DEFAULT 1,
    `date`                          int(10) unsigned    NOT NULL DEFAULT 0,
    `type`                          varchar(250)        NOT NULL DEFAULT 'user',
    `success`                       char(1)             NOT NULL DEFAULT 'y',
    `from`                          text,
    `from_name`                     text,
    `to`                            text,
    `subject`                       text,
    `message`                       text,
    `debug_info`                    text,
    PRIMARY KEY                     (`id`)
) CHARACTER SET utf8 COLLATE utf8_general_ci;;

```
> 0 votes

# Answer
I'm having the same error. Interestingly I can install it on my local MAMP install, but not on the staging site, so it could be an environment issue.
> 0 votes

---
Tags: solspace-freeform, solspace
---


# Question
Title: Expression Engine RSS Feed PubDate doesnt validate
I'm running out of ideas, could you please tell me what am I doing wrong? When trying to validate my rss feed I get the error that pubDate is in incorrect format. Even though it looks the same as advised in specs (well to me at this stage). Can you spot the error?

```
{preload_replace:master_channel_name="blog_post"}
{exp:rss:feed channel="{master_channel_name}" debug="yes"}

<?xml version="1.0" encoding="{encoding}"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom">

    <channel>
    <atom:link href="http://www.yourpeakstate.com" rel="self" type="application/rss+xml" />
    <atom:link href='http://pubsubhubbub.superfeedr.com/' rel='hub' />
    <title><![CDATA[{channel_name}]]></title>
    <link>{site_url}</link>
    <description>{channel_description}</description>
    <dc:language>{channel_language}</dc:language>
    <dc:creator>{email}</dc:creator>
    <dc:rights>Copyright {gmt_date format="%Y"}</dc:rights>
    <admin:generatorAgent rdf:resource="http://expressionengine.com/" />

{exp:channel:entries channel="blog_post" limit="10" dynamic_start="on" disable="member_data"}
     <item>
       <title>{exp:xml_encode}{title}{/exp:xml_encode}</title>
       <link>{page_url}</link>
       <dc:creator>{author_name}</dc:creator>
       <pubDate> {gmt_entry_date format="%D, %j %M %Y %H:%i:%s %Q"} </pubDate>
       <guid>{page_url}#When:{gmt_entry_date format="%H:%i:%sZ"}</guid>
       <description><![CDATA[<img src="{main_post_image}" alt="{post_title} - Your Peak State"> {blog_content_1} {blog_content_2}]]></description>
       <dc:subject>{exp:xml_encode}{categories backspace="1"}{category_name}, {/categories}{/exp:xml_encode}</dc:subject>
     </item>
{/exp:channel:entries}

    </channel>
</rss>

{/exp:rss:feed}

```

Here is validation error: https://validator.w3.org/feed/check.cgi?url=http%3A%2F%2Fwww.yourpeakstate.com%2Frss%2Farticle-feed

I might be blind though as I've been looking at this for the past 2 hours...

It Tells me this should be the output:

```
<pubDate>Wed, 02 Oct 2002 08:00:00 EST</pubDate>
<pubDate>Wed, 02 Oct 2002 13:00:00 GMT</pubDate>
<pubDate>Wed, 02 Oct 2002 15:00:00 +0200</pubDate>

```

But this is the output I get:

```
<pubDate>Thu, 06 Aug 2015 17:50:00 +00:00</pubDate>

```

# Answer
Ok I figured out what is the problem. This is the correct, pubDate format incase someone else encounters this problem in the future...

```
<pubDate> {gmt_entry_date format="%r"} </pubDate>

```

I spent 2 hours for simple thing like this... Might save someone else the time in the future.. You're Welcome
> 2 votes

---
Tags: validation, rss
---


title: Solspace Calendar - Occurrence

text:
# Question
Title: Solspace Calendar - Occurrence
I have two different types of events that show up on the same template. If the event is a multi-day event, I classify it as such using a category. If it is a single day event, it is classified as another event.

I am running into issues trying to get a section that I have added for future events to work. According to the Solspace website, I can use the {exp:calendar:occurrences} tag to make this happen, & it works great for one group, but not the other.

I have my main /calendar template where I have two sets of codes set up.

```
<!-- Multi Day Events -->
{if category =="124"}
{embed="/site/calendar_multi"}
{/if}
<!-- End Multi Day Events-->

<!-- Single Day Events-->
{if category !="124"}
{embed="/site/calendar_single"}
{/if}
<!-- End Single Day Events-->

```

The /site/calendar\_single looks like this:

```
    {exp:calendar:events
            orderby="title"
            sort="asc"
            event_id="{segment_3}"
            category="54"
            limit="1"
            dynamic="off"}

    <div class="typography">
    <div class="title_entryBIGG" style="width:98%;margin-top:10px:">
        <br/>
        <br/>

    <a href="/calendar_download/event/{segment_3}" target="_blank" class="btn btn-default btn-sm pull-left" role="button">
    <span class="glyphicon glyphicon-export" aria-hidden="true"></span>Export Event
    </a>

        {if hours != ""}
            <span style="float:right;margin-top:-50px;text-align:right;"><h5>Continuing Education Hours<br><span style="color:#2079b5;font-size:300%;">{hours}</h5></span></span>
        {/if}

    {if title_online == ""}
            <h5 class="title" style="margin-top:65px;font-size: 350%;">{event_title}</h5>
    {/if}

    {if title_online != ""}
    <h5 class="title" style="margin-top:65px;font-size: 350%;">{title_online}</h5>
    {/if}
    <br>
    <h2 class="title" style="margin-top:0px;margin-bottom:5px;border-bottom:none;"><b>Next Occurrence</b>:
       {exp:calendar:occurrences event_id="{segment_3}" show_months="6" date_range_start="today" occurrences_limit="1" }
       {occurrence_start_date format="%l, %F %j, %Y from %g:%i%a"} - {occurrence_end_date format= "%g:%i%a"}
       {/exp:calendar:occurrences}
    </h2>

    {if events_price != ""}<h2 class="title" style="margin-top:0px;margin-bottom:5px;border-bottom:none;"><b>Price</b>: {events_price}</h2>{/if}

    {if instructor_name != ""}<h2 class="title" style="margin-top:0px;margin-bottom:5px;border-bottom:none;"><b>Instructor</b>: {instructor_name}</h2>{/if}

    {if course_number != ""}<h2 class="title" style="margin-top:0px;margin-bottom:5px;border-bottom:none;"><b>Course</b> #: {course_number}</h2>{/if}

    {if provider_number != ""}<h2 class="title" style="margin-top:0px;margin-bottom:5px;border-bottom:none;"><b>Provider</b> #: {provider_number}</h2>{/if}
    {if event_location != ""}<h2 class="title" style="margin-top:0px;margin-bottom:5px;border-bottom:none;"><b>Location</b>: {event_location}</h2>{/if}

    {if register != ""}<h2 class="title" style="margin-top:0px;margin-bottom:5px;border-bottom:none;"><b>To Register</b>: <a href ="{site_url}login/my_account/"> Click Here </a></h2>{/if}
    <hr>
    {if calendar_uploads != ""}
    <ol class="document_upload">
    {calendar_uploads}
    <li><a href="{cell_1}">{cell_2}</a></li>
    {/calendar_uploads}
    </ol>
    {/if}

    {if event_summary != ""}<p class="details_copy" style="font-size=125%;">{event_summary}</p>{/if}
    <br><br>
    {if cancellation_policy =="CE"} <h3 style="text-align: center;"><span style="color:#b22222"><strong>CANCELLATION POLICY:  Full refund if written notification is received by 48 hours before class starts.  NO REFUNDS will be issued after 24 hours prior to class. Transfer to another class can be made up to 24 hours before class begins.  The new class cannot be refunded.</strong></span></h3>{/if}
    {if cancellation_policy =="Designation"} <h3 style="text-align: center;"><span style="color:#b22222"><strong>Cancellation Policy:  Full refund if written notification is received 2 weeks prior to class start date. Otherwise, a $25.00 cancellation fee will be deducted from your refund. NO REFUNDS will be issued is cancellation occurs within 1 week of class start date.</strong></span></h3>{/if}
    <br><br>

    <!-- Future Dates -->

    <div class="panel panel-default">
    <div class="panel-heading">
    <h3 class="panel-title">Future Dates</h3>
    </div>
    <div class="panel-body">
            {exp:calendar:occurrences
              event_id="{segment_3}"
              occurrences_offset="1"
              date_range_start="21 month"
              date_range_end="12 months"
              dynamic="off"
            }
            {if calendar_no_results}
            There are currently no future dates/times for this item within the next 12 months. We have many other classes and events on the <a href="/calendar_list">calendar</a> in the meantime.
            {/if}
    <ul class="list-group" style="margin-bottom:0px;">
            <li>
             {occurrence_start_date format="%l, %F %j, %Y - %g:%i%a"}
            </li>
            {/exp:calendar:occurrences}
        </ul>
    </div>
    </div>
    </div>
    </div>
    <!--End of Future Dates -->

{/exp:calendar:events}

```

The /site/calendar\_multi looks like this:

```
{exp:calendar:events
        orderby="title"
        sort="asc"
        event_id="{segment_3}"
        limit="1"
        category="124"
        dynamic="off"}

<div class="typography">
<div class="title_entryBIGG" style="width:98%;margin-top:10px:">
    <br/>
    <br/>

<a href="/calendar_download/event/{segment_3}" target="_blank" class="btn btn-default btn-sm pull-left" role="button">
<span class="glyphicon glyphicon-export" aria-hidden="true"></span>Export Event
</a>

    {if hours != ""}
        <span style="float:right;margin-top:-50px;text-align:right;"><h5>Continuing Education Hours<br><span style="color:#2079b5;font-size:300%;">{hours}</h5></span></span>
    {/if}
    {if title_online == ""}
        <h5 class="title" style="margin-top:65px;font-size: 350%;">{event_title}</h5>
{/if}

{if title_online != ""}
<h5 class="title" style="margin-top:65px;font-size: 350%;">{title_online}</h5>
{/if}
<br>
<h2 class="title" style="margin-top:-10px;margin-bottom:5px;border-bottom:none;"><b>Class Dates</b>:<br>
   {exp:calendar:occurrences event_id="{segment_3}" show_months="6" date_range_start="today" }
   <ul style="margin-bottom:-25px;">
   <li style="margin-top:-25px;">{occurrence_start_date format="%l, %F %j, %Y from %g:%i%a"} - {occurrence_end_date format= "%g:%i%a"}</li>
</ul>
   {/exp:calendar:occurrences}
</h2>

{if events_price != ""}<h2 class="title" style="margin-top:35px;margin-bottom:5px;border-bottom:none;"><b>Price</b>: {events_price}</h2>{/if}

{if instructor_name != ""}<h2 class="title" style="margin-top:0px;margin-bottom:5px;border-bottom:none;"><b>Instructor</b>: {instructor_name}</h2>{/if}

{if course_number != ""}<h2 class="title" style="margin-top:0px;margin-bottom:5px;border-bottom:none;"><b>Course</b> #: {course_number}</h2>{/if}

{if provider_number != ""}<h2 class="title" style="margin-top:0px;margin-bottom:5px;border-bottom:none;"><b>Provider</b> #: {provider_number}</h2>{/if}
{if event_location != ""}<h2 class="title" style="margin-top:0px;margin-bottom:5px;border-bottom:none;"><b>Location</b>: {event_location}</h2>{/if}

{if register != ""}<h2 class="title" style="margin-top:0px;margin-bottom:5px;border-bottom:none;"><b>To Register</b>: <a href ="{site_url}login/my_account/"> Click Here </a></h2>{/if}
<hr>
{if calendar_uploads != ""}
<ol class="document_upload">
{calendar_uploads}
<li><a href="{cell_1}">{cell_2}</a></li>
{/calendar_uploads}
</ol>
{/if}

{if event_summary != ""}<p class="details_copy">{event_summary}</p>{/if}
{if cancellation_policy =="CE"} <h3 style="text-align: center;"><span style="color:#b22222"><strong>CANCELLATION POLICY:  Full refund if written notification is received by 48 hours before class starts.  NO REFUNDS will be issued after 24 hours prior to class. Transfer to another class can be made up to 24 hours before class begins.  The new class cannot be refunded.</strong></span></h3>{/if}
{if cancellation_policy =="Designation"} <h3 style="text-align: center;"><span style="color:#b22222"><strong>Cancellation Policy:  Full refund if written notification is received 2 weeks prior to class start date. Otherwise, a $25.00 cancellation fee will be deducted from your refund. NO REFUNDS will be issued is cancellation occurs within 1 week of class start date.</strong></span></h3>{/if}

{/exp:calendar:events}

```

On my multi-day events, I am still getting the "There are currently no future dates/times for this item within the next 12 months. We have many other classes and events on the calendar in the meantime" at the end of my entries. The formatting is stripped out, but the code is showing up. I am about to pull my hair out! Any ideas?

# Answer
**For future/upcoming events and their occurrences, use `{exp:calendar:cal}`**. It's the only tag that will calculate events and occurrences chronologically. Details on why `{exp:calendar:cal}` is the tag to use can be found in this very recommended read:

https://solspace.com/docs/calendar/getting\_started/

If you want events/occurrences for the next 6 months, for example, you would do something like this:

```
{exp:calendar:cal
    date_range_start="today"
    date_range_end="+6 months"
    pad_short_weeks="n"
    /* your other parameters */}

    ... Your upcoming event data ...

{/exp:calendar:cal}

```
> 1 votes

# Answer
Does the future events section work stand alone?

I think the issue may be that you have nested tags.

Try making your future events loop into an embed and pass it segment\_3.

```
{embed='future_events' entry_id="{segment_3}"}

```

then

```
{exp:calendar:occurrences event_id="{embed:entry_id}" etc....}

```
> 0 votes

---
Tags: solspace, conditionals, calendar
---


title: Solspace Tag custom placeholder

text:
# Question
Title: Solspace Tag custom placeholder
I just updated tag to the latest version of Tag and noticed a placeholder "Press Enter after each Tag" has been added to the field.

How can I customise the the text here?

(All the fields across the site have placeholders instead of titles, so would be great to do this here too.)

Cheers!

# Answer
> 1 votes
The answer is clear. You have two options. First, you can modify core files of Tag. This is totally not recommended, because you'll have to re-edit these files after every Tag module update... but for what you're looking to do, it's a pretty simple re-hack. You need to edit this file:

```
you_web_root/system/expressionengine/third_party/tag/language/english/lang.tag.php

```

Go to line 350, and it looks like this:

```
'press_enter_after_each_tags' =>
"Press [Enter] after each tag",

```

And edit the value of the key `press_enter_after_each_tags`.

Your other option, which will probably prevent you from having to edit that file after every Tag module update, is to make an EE Accessory. This allows you to inject code on the Control Panel pages. Basically, you'd insert some code on the edit\_entry pages that looks like this:

```
$('.tag_input').attr('placeholder', 'Whatever you wanted for a placeholder');

```

Here's the Accessory Development reference:

https://ellislab.com/expressionengine/user-guide/development/accessories.html

---
Tags: solspace, solspace-tag
---


title: CE Image, Assets, S3 and Caching

text:
# Question
Title: CE Image, Assets, S3 and Caching
We’re using CE Image along with Assets images stored in S3. We’ve used curl to go through all the pages so that CE Image does its thing to the image and stores its “made” image in S3. The hopes is to cut down the load time when a user goes to that page., BUT we’re still seeing slowdown when a user visits a page with CE Image modified/stored S3 images. Other pages open up really fast.

It seems like CE Image isn’t using the already existing “made” image on S3, but instead is double-checking each image over again. Does that make sense? How can we speed up the load time of CE Image assets? Particularly with pages that have a lot of images.

Example of how we're using CE Cache to wrap CE Image/Assets tags:

```
{exp:ce_cache:it id="{g:alamo_market:url_title}-slider-on-sale" tags="schedules" global="yes"}
<div class="row">
  <div class="medium-12 columns">
    <div class="js-slider-6 Slider">
    {exp:channel:entries
      channel="schedules"
      disable="categories|member_data|pagination"
      dynamic="no"
      status="{global:status}"
      entry_id="{segment_3}"
    }
      {schedule_on_sale}
        {schedule_show}
        <div class="Card Card--overlay">
          {show_poster var_prefix="file"}
            <img src="{exp:ce_img:pair src="{file:url}" width="396" height="594" crop="yes" save_type="jpg" allow_scale_larger="yes" quality="81" hide_relative_path="yes"}{made}{/exp:ce_img:pair}" alt="">
          {/show_poster}
          <a class="Card-overlayContent" href="{site_url}show/{url_title}">
            <div class="Card-overlayText">
              <h5 class="Card-overlayHeading">{title}</h5>
            </div>
          </a>
          <div class="Card-overlayButton">
            <a class="button tiny expand u-noMarginBot" href="{site_url}show/{url_title}">Buy Tickets</a>
          </div>
        </div>
        {/schedule_show}
      {/schedule_on_sale}
    {/exp:channel:entries}
    </div>
  </div>
</div>
{/exp:ce_cache:it}

```

# Answer
A good way to do this is to cache the output of the tag. You can use built-in EE tag caching or something like CE cache, either with fragment caching or full page static. This way you're getting the resized URL and CE Image doesn't keep hitting S3.

We've had extremely high traffic sites where we actually create a local redis key/value store to keep track of what's already been uploaded to S3 and modify CE Image to check that before doing anything, but that only becomes relevant on multiple front-end instance sites. Before that you're probably best off just with regular fragment or page caching.
> 1 votes

---
Tags: assets, performance, ce-image, cache, s3
---


# Question
Title: Expresso-store How to view order ID in paypal invoice
I've just upgraded a client from Expresso Store V1.6 to V2. They use Paypal Express.

Previously the Store would list the order number as a line item in the paypal invoice, but now it lists the products and doesn't mention the store order number. They have requested this back as they use this order number to reference payments and deliveries, also sometimes people pay with cards not in their name so using the order number avoids confusion.

Any ideas?

# Answer
As of version 2.5.0 of Store order id's are assigned after an order is completed.

> Changed the way order\_id's are generated. Only completed orders are given a order id. Order id's are sequential per site.

The easiest method would be to setup an email template for your site admins that sends the relevant order details from Store when an order is completed instead of relying on the PayPal payment emails.

This would allow you to also use any Store fields for things like order items, shipping/billing details too.

If you were to go this route you would need to use the orders tag pair.
> 0 votes

---
Tags: expresso-store
---


# Question
Title: expresso-store : add item to order backend doesn't decrease stock
Hi I'm just wondering if this is a bug or not. When you add an item with inventory to an order in the admin panel, the stock does not reduce, which I believe it should. We have to go back into the product and manually reduce the stock qty.

Let me know

# Answer
This does indeed sound like a bug.

Bug reports are best sent directly to the developer along with the version of Store you are using and the version of EE and any steps that you need to recreate the issue.

You can contact DevDemon by either email (support@exp-resso.com) or by the support form.
> 0 votes

---
Tags: expresso-store
---


# Question
Title: Is it possible to have multiple database connections for ExpressionEngine?
When setting up the database settings of a project I know that there is the default active group "expressionengine" found in the database.php file and you can add more than one group, I was just wondering if there is a way that I could load at most 2 database connections at the same time.

# Answer
> 0 votes
Sorry it took too long, if anyone wanted to do this and have multiple connections just follow these steps like I did: http://tutsnare.com/connecting-multiple-database-in-codeigniter/. hope it helps

---
Tags: database
---


title: Japanese Language Pack

text:
# Question
Title: Japanese Language Pack
I've checked the existing Language Packs for ExpressionEngine and to no avail there is none for Japanese. Does anyone know where I can get this?

# Answer
> 0 votes
Sometimes you can find these things on Github. I found one: https://github.com/nicolasbottari/japanese.ee2\_language\_pack

---
Tags: multi-language, language
---


# Question
Title: Filter entries based on multiple custom fields (paginated)
I have a channel called **articles** to post image galleries or video's or both.

On the back-end there are two custom fields in that channel (1) a 'channel images' field to add multiple images to the post and (2) a matrix field to add multiple video by (a) adding a valid YouTube or Video URL into a 'video link' field OR (b) via adding the embed code into a textarea field, in which case there is a 3td field, an 'assets' field to add a thumbnail.

On the front-end every article is **required** to have a thumbnail image. In the source code, I first check if there is an image given in the 'channel images' field, and if so, grab the first image as a thumbnail. If not, I check to see if there is a matrix row and if the 'video link' field is not empty, and if so, grab the YT of Vimdeo thumbnail via that plugin. If that field is empty, I check to see if the embed code textarea field AND assets field are not empty, and grab the assets image as a thumbnail in that case.

This all works except that if the fields are NOT set, the entry is not shown on the page but it IS included in the pagination and number of rendered entries. So if I want to always display 9 entries per page (3 x 3 blocks), and one entry has OR no channel images input, OR no valid video link input, OR no embed code + assets input, I have 8 entries on the page + the pagination total entries does not add up.

You can not set the required field option conditionally when adding a custom field in the CP.

How do I pre-filter the entries based on conditional logic on multiple custom fields before they are rendered?

The search parameter is not sufficient.

# Answer
> 0 votes
If you're gonna use Low Search, then the only way to do this properly, is to use a custom filter.

---
Tags: channel-entries, search, low-search, filter
---


# Question
Title: Missing data - different IP error when submitting a form
Has anyone ever come across this error before? I've never seen it.

When a form is submitted, users get the error shown in the screenshot attached.

# Answer
> 0 votes
Just spitballing here, but some sort of misconfigured proxy is the first thing that jumps out at me.

# Answer
> 3 votes
OK, I found a quick fix / workaround for this.

What the Forms Module looks to be doing is checking the IP address of where the form data is coming from, to the IP address that the form thinks it is.

system/expressionengine/third\_party/forms/act.forms.php

And at around line 82 you should see:

```
    // Same IP?
    if ($this->EE->forms->data['ip_address'] != $this->EE->forms->ip_address)
    {
        return $this->return_error('missing_data', $this->EE->lang->line('form:error:missing_data') . '(DIFFERENT_IP)');
    }

```

I commented out these lines and it's working again. Why it started to do this I've no idea, the External IP has not changed, I've cleared the cache, I've rebooted the server, still no luck.

FINAL EDIT : We have a load balancing server. The IP address that the web server sees for that server is obviously different to the external IP address the visitor comes in on. Two different IP addresses. Why it just started happening now is still a mystery.

# Answer
> 1 votes
Thanks for that , same thing happened to me when I turned on cloudflare cdn for my site. I did it via Cname so it changed my visible ip and caused the problem with all of my forms. Commenting those lines sorted it out for me. I am going to submit a ticket to devdemon to see if they have a more structured solution

---
Tags: forms
---


# Question
Title: Undefined variable: whitelist whenever trying to interact with files
For some reason im getting these errors whenever i interact with the file manager

```
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: whitelist
Filename: libraries/Mime_type.php
Line Number: 48

A PHP Error was encountered
Severity: 4096
Message: Argument 1 passed to EllisLab\ExpressionEngine\Library\Mime\MimeType::addMimeTypes() must be of the type array, null given, called in /home/forge/default/system/expressionengine/libraries/Mime_type.php on line 48 and defined
Filename: Mime/MimeType.php
Line Number: 82

A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: Mime/MimeType.php
Line Number: 84

```

It wont let me upload new files, or synchronize directories?

Its running EE 2.10.1, on a laravel forge made server. I checked all the folder permissions and it looks fine? any other ideas?

# Answer
Did you run an EE upgrade recently?? They changed how they detect mime types:

https://ellislab.com/expressionengine/user-guide/about/changelog.html

Look at the change log for 2.10. They use a different mime-type library now... sounds like you upgraded, but it's possible your PHP version is out of date or missing a required module... please let us know your EE version, if you've upgraded, and your PHP and Apache version.

**Edit** Ahhhh... check out this file:

```
system/expressionengine/config/mimes.php

```

Does it look like this, and does it have file permissions set to 664??

```
$whitelist = array(
    'application/csv', // .csv
    'application/epub+zip', // .epub
    'application/excel', // .csv, .xl, .

    /* and so on ... */

    'video/x-ms-wmv', // .wmv
    'video/x-msvideo', // .avi
    'video/x-sgi-movie', // .movie
);

```

It's possible, that for some reason, that file wasn't updated. They changed the variable name of how they stored mime types as well.
> 2 votes

---
Tags: file-uploads, file-manager
---


# Question
Title: How can we create custom capability for a member group so that we can check in our module and give access to it
I am creating a module for a simple form submission. In admin, I am showing a table view of all entries. I have a specific member group "pitch" who can access only that module. In addition they can't access the "Export in CSV" functionality for listing. But super admin can do all things.

1. How can I create a custom privilege for "pitch" member group so that they can't access "Export" button.
2. OR hide button if "pitch" member login in CP
3. How can we do this through module?
4. Please provide a reference url or a piece of code.

# Answer
You could use the add on CP CSS & JS to hide the button with CSS as you already suggest yourself. I know there are options to check for member privileges in add-ons but I don't know them off the top of my head.

Edit:

You could use this code in your module. More info:

```
if (ee()->session->userdata('group_id') == 1)
{
    exit('A Superadmin');
}

```
> 0 votes

---
Tags: members, control-panel, module
---


# Question
Title: Date conditionals not working as they should
Im using this code which as of todays date should display 11 Sept but instead it displays 20 Feb?? Cant figure out what is wrong

```
{if {current_time format="%d.%m"} >= 06.11 && {current_time format="%d.%m"} <= 07.01}
6 Jan

{if:elseif {current_time format="%d.%m"} >= 06.01 && {current_time format="%d.%m"} <= 21.02}
20 Feb

{if:elseif {current_time format="%d.%m"} >= 20.02 && {current_time format="%d.%m"} <= 28.03}
27 Mar

{if:elseif {current_time format="%d.%m"} >= 27.03 && {current_time format="%d.%m"} <= 16.05}
15 May

{if:elseif {current_time format="%d.%m"} >= 15.05 && {current_time format="%d.%m"} <= 04.08}
3 Aug

{if:elseif {current_time format="%d.%m"} >= 03.08 && {current_time format="%d.%m"} <= 12.09}
11 Sept

{if:elseif {current_time format="%d.%m"} >= 11.09 && {current_time format="%d.%m"} <= 07.11}
6 Nov
{/if}

```

# Answer
`{current_time format="%d.%m"}` is not a number (integer or decimal) Try putting what your comparing to in double quotes.

```
{current_time format="%d.%m"} >= "06.11"

```

Then it should perform a string comparison and not a numeric one.

EDIT: I just tested this and it works.

```
{if {current_time format="%d.%m"} >= "18.08" && {current_time format="%d.%m"} <="18.09" }Sept 11 {if:else}Ooops{/if}

```
> 0 votes

---
Tags: conditionals, date
---


title: CE Images and Grid with Fancybox

text:
# Question
Title: CE Images and Grid with Fancybox
I want to add CE Image to this gallery, its a fancybox light box gallery. The code below works fine, but every time I try to add CE Images, it breaks. How do I but CE image in this code?

This code works fine, how do I integrate {exp:ce\_img:single src="{grid\_gallery:pop\_up\_photo}" width="600" crop="yes"}

There is two instances of photos.

```
  {exp:channel:entries channel="photo_gallery" }
  <div class="span12">
  <h2 class="title-divider"><span>{title}</span></h2>
  </div>

    <!-- Photo Gallery -->

        {grid_gallery}

        <div class="span3 gallery img-portfolio">
        <a href="{grid_gallery:pop_up_photo}" class="thumbnail img-hover" rel="image" title="{grid_gallery:caption}" >
        <img class="img-responsive zoom-image" src="{grid_gallery:small_photo}"> </a>
        </div>

         {/grid_gallery}

         {/exp:channel:entries}

```

# Answer
> 0 votes
Here is an example from the CE Image user guide (http://www.causingeffect.com/software/expressionengine/ce-image/user-guide):

```
<a href="{grid_gallery:pop_up_photo}" class="thumbnail img-hover" rel="image" title="{grid_gallery:caption}" >
    {exp:ce_img:pair src="{grid_gallery:small_photo}" max="100"}
        <img src="{made}" alt="" width="{width}" height="{height}" />
    {/exp:ce_img:pair}
</a>

```

This example would convert your image to have a maximum width and maximum height of 100 pixels. CE Image also caches files (I believe), so it wouldn't do the image resize every time, just whenever the image changes. If you are having issues getting this plugin to work, first verify that it is installed. Visit this page in your Control Panel:

```
Your Website -> CP Home -> Add-ons -> Plugins

```

And make sure you see CE Image listed there. You also need to make sure some paths are created and have the correct permissions to use this plugin:

http://www.causingeffect.com/software/expressionengine/ce-image/user-guide/installation

That link will guide you if you're still having issues. Lastly, your best option to figuring out this plugin, is to play with it! Create a template that only SuperAdmins can see, and test it out! Try something like this:

```
{exp:ce_img:pair src="https://ellislab.com/asset/css/img/logo.png" width="200" height"400"}
    <img src="{made}" alt="" width="{width}" height="{height}" />
{/exp:ce_img:pair}

```

**Edit** You don't need **two** images anymore! Just one!

```
<a href="{grid_gallery:pop_up_photo}" class="thumbnail img-hover" rel="image" title="{grid_gallery:caption}" >
    {exp:ce_img:pair src="{grid_gallery:pop_up_photo}" max="100"}
        <img src="{made}" alt="" width="{width}" height="{height}" />
    {/exp:ce_img:pair}
</a>

```

Assuming `{grid_gallery:pop_up_photo}` is your full sized image, what the previous code block does is link to your full size image (the anchor tag), and puts a thumbnail img tag inside that anchor. The `{made}` tag is a link to the new, converted, and in this case, shrunken image. The `{width}` and `{height}` tags come from whatever you set them as (in this case, since we set a `max` parameter, CE Image will scale it down until neither width or height is above 100 pixels).

If you wanted to generate guaranteed width and height thumbnails, you would just set those parameters instead of `max`:

```
{exp:ce_img:pair src="{grid_gallery:pop_up_photo}" height="128" width="64"}
    <img src="{made}" alt="" width="{width}" height="{height}" />
{/exp:ce_img:pair}

```

---
Tags: grid, ce-image
---


# Question
Title: How to template a relationship field with multiple relations
I'm trying to build a channel form for updating channel entry data. In this scenario, I'm relating a farmer to multiple butchers.

```
{exp:zoo_visitor:update_form}
    ...
    <ul id="slaughterhouses">
        <li class="selected">
            <label>{f_butchers:title}</label>
            <input type="checkbox" name="f_butchers[data][]" value="{f_butchers:entry_id}" checked/>
        </li>
    </ul>
    ...
{/exp:zoo_visitor:update_form}

```

This entry currently has 2 selected butcher entries selected. But only one is rendered on the template. **I've tried wrapping the `<li>` element in `{f_butchers}` pair tags to no avail.**

In fact, wrapping them in `f_butcher` pair tags breaks the template parser and I get `{f_butchers:title}` instead of the actual butcher title. But once I wrap those pair tags in the `{exp:zoo_visitor:details}` pair tag, I get the one entry again. Still doesn't output the second entry.

The default `{field:f_butchers}` won't be enough since I need to do custom styling.

Does anyone know how to correctly template this field data?

# Answer
> 0 votes
... broheim, you have to use relationships as a variable **pair** to loop over it, otherwise it just outputs one entry:

```
{exp:zoo_visitor:update_form}
    ...
    <ul id="slaughterhouses">
        {f_butchers}
        <li class="selected">
            <label>{f_butchers:title}</label>
            <input type="checkbox" name="f_butchers[data][]" value="    {f_butchers:entry_id}" checked/>
        </li>
        {/f_butchers}
    </ul>
    ...
{/exp:zoo_visitor:update_form}

```

**Edit**

Ok... stupid question, but are you sure both relationship entries have a status that is displayable, IE, status = **Open** ?

---
Tags: safecracker, relationships, zoo-visitor
---


title: Exp:resso Store Stock Issues

text:
# Question
Title: Exp:resso Store Stock Issues
Trying to get my online store up & running, but I'm having issues with the stock aspect of Store.

I'm using the default code that came with Store for individual products, aside from having removed the SKU section. When I create a product entry, I'm selecting "Limit Stock", then selecting the checkbox under that & inputting the qty. of product I have. (Let's say 8.) I go about the rest of my business, creating the product post - publish it, refresh the page, and where Stock is located in the form, it's outputting absolutely nothing. Should there not be "8" next to "Stock"?

Here's the snippet of code for that particular area, as well as the URL where you can see what I'm talking about:

```
<div class="control-group">
<label class="control-label">Stock Qty:</label>
<div class="controls">
<span class="store_product_stock">
<!-- automatically set -->
</span>
</div>
</div>

```

Product Dev

(That commented out part that says "automatically set" was there when the module propagated the templates.)

I've tried putting the following in it's place, but I still get an empty result.

```
{if total_stock > 5}
In Stock
{if:elseif total_stock <= 5 && total_stock != 0}
Low Stock
{if:else}
Out of Stock
{/if}

```

I suppose I really don't understand how it's supposed to work, and your help would be greatly appreciated. Thank you! :)

# Answer
Stock is calculated based upon the modifiers selected in your template. For example lets saying I am selling t-shirts in 3 different colors and 4 different sizes.

When I load the page I won't see a stock number using the classes until I select Med Green shirt which might have 8 in stock, if I then select red instead of green it would change to 3 since I only have 3 medium red shirts in stock.

EDIT:

From the comments below.

The Store javascript that handles the span class to show things like price or stock based upon modifier selection you will need to make sure that you have jQuery is included on your pages with Store tags.
> 1 votes

# Answer
Common practice in modern sites is that all .js files are loaded at the end of page. How to fix problem with store.js then? EE checks if "store.js?v=" is present then adds it if not. If you load all JS files at the end of page with actual store.js file in it, script will never find it and will add it just above those files. If you add all files as snippet (to maintain page easily) then you have duplicates and of course error: jQuery is not defined

Any news how to solve this issue?
> 0 votes

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


# Question
Title: Suggested keyword or alternative search results
We've trying to show suggested searches and initially hoped that the new lexicon and suggestions-tag would help but they do not.

Couple of examples:

Added sennheiser as a lexicon, search for sennheizer, sennhiser. it returns the suggestions as we would expect.

So far, so good :)

Searching for senhizer returns no results and no suggestions?

We also have company names we want to add such as i-Movix. When we try adding them as a lexicon it says 'i-Movix' is not a valid word.

Is there a way to improve this?

Current results tag:

`{exp:low_search:results
 query="{segment_2}"
 {if get:collection}channel="{get:collection}"{/if}
 require_query="yes"
 limit="10"
paginate="bottom"
 status="not closed"
 disable="member_data|category_fields"
 orderby="date"
 keywords:loose="both"
 }`

# Answer
Answered of GetSat - thanks Low!

> The keyword suggestions, by default, uses a Levenshtein algorithm to determine the distance between two words, and limits suggestions by it. Most likely, searching for "senhizer" the distance is simple too far, and therefore the term "sennheiser" is not included. You can try tweaking the parameters: set the distance to 3, or try using Soundex instead.

As for words with hyphens -- they are currently considered two words. Treating hyphenated words as single words is not supported at the moment.

I was also thinking about this... if there are specific spelling corrections such as 'senhizer' then the simplest fix would be an additional field for the given channel, say 'search\_keywords'.

This could then be populated with these alternative keywords, added to the collection and given a weight.

Then searches would result the correct result. :)
> 0 votes

---
Tags: low-search
---


title: Add active class to Solspace Tag list

text:
# Question
Title: Add active class to Solspace Tag list
I have a list of tags on my site and want to add an active class to the linked tag based on the URL. For example, if the user is on the URL http://whatever.com/blog/by\_tag/control+system+failure, I want "Control System Failure" from the list of all tags to have the active class.

I'm using this code:

```
{exp:tag:cloud
    channel="blog_entry"
    limit="25"
}
    <li class="{if '{segment_3}'=='{websafe_tag}'}active{/if}">
         <a href="{path='blog/by_tag'}/{websafe_tag}">{tag}</a>
    </li>
{/exp:tag:cloud}

```

However, it doesn't work because {segment\_3} displays the tag name without the + separator. For example
{websafe\_tag} = control+system+failure
{segment\_3} = control system failure

I've even tried using {last\_url\_segment} from the Current Extension, but that also produced the tag without the plus sign.

Does anyone have any ideas on how I can get the active class added?

# Answer
> 0 votes
Indeed `{segment_x}` would replace `+` with a space  when parsed in templates, so `{segment_3}` and `{websafe_tag}` wouldn't match. Here are a few possible solutions:

* Instead of `{websafe_tag}`, why not use `{tag}`? `control+system+failure` would be `control system failure`, which should match the `{segment_3}` which has spaces instead of `+` in templates.
* You could always use tag\_ids in your URL instead of websafe\_tag. You can't go wrong with IDs, since they don't vary like words do.
* You could use PHP to replace spaces with `+` in `{segment_3}` (or replace `+` with spaces in `{websafe_tag}`. Try turning on PHP and set it to Input and try this: `{if "<?php echo str_replace(' ', '+', '{segment_3}'); ?>" == websafe_tag}`. `{segment_3}` should parse before PHP kicks in, and therefore be available to the `str_replace()` PHP function.

---
Tags: solspace, conditionals, tags, solspace-tag, css
---


title: IP to Nation cron job

text:
# Question
Title: IP to Nation cron job
Is it possible to get a cron job url in order to update the IP to nation database?

I could use the url used in the ajax call when updating the database manually. But it requires an active session.

# Answer
IP to Nation doesn't set an action (ACT), so I don't think there's a neat way of doing this.

In ExpressionEngine, actions are given a unique ID and you can load /index.php?ACT=1234 to execute the action's code. For modules that use ACT you can run cron jobs by curl'ing the URL.
> 1 votes

---
Tags: cron, iptonation
---


# Question
Title: Change number of entries in multiple lists based on viewport size
I have the code below, where I am generating a new list for each 16 entries using Grouper plugin. Note, these list items are being ordered by last name.

However, when the viewport width is reduced and those columns collapse underneath one another, the alphabetical ordering is no longer correct.

I thought if I used MX Mobile Detect plugin, I could write a conditional to output a different `groupby="number"` based on the viewport size, but unfortunately that plugin is not working on EE v2.10.1, throws an infinite loop and page won't load, and it doesn't look like it's supported any longer.

**2 questions:**

1. Are there any plugins to achieve what I'm trying to accomplish?
2. If not, any recommendations on how to accomplish this?

**HTML:**

```
<div class="col-holder clearfix text-capitalize speakers-menu large-menu">
    {exp:channel:entries channel="speakers" dynamic="off" orderby="last_name" search:navigation_exclude="not y" sort="asc"}
        {exp:grouper:start groupby="16" count="{count}" total="{total_results}"}
            <ul class="list-unstyled">
        {/exp:grouper:start}
                <li><a href="{url_title_path='site/speaker'}">{title}</a></li>
        {exp:grouper:end groupby="16" count="{count}" total="{total_results}"}
            </ul>
        {/exp:grouper:end}
    {/exp:channel:entries}
</div>

```

As an added note, I was able to build something out that works as a temp fix, but definitely clunky and redundant code and not how I like it. I assigned a different class to each div, `large-menu` and `small-menu`.

**HTML:**

```
<div class="col-holder clearfix text-capitalize speakers-menu large-menu">
    {exp:channel:entries channel="speakers" dynamic="off" orderby="last_name" search:navigation_exclude="not y" sort="asc"}
        {exp:grouper:start groupby="16" count="{count}" total="{total_results}"}
            <ul class="list-unstyled">
        {/exp:grouper:start}
                <li><a href="{url_title_path='site/speaker'}">{title}</a></li>
        {exp:grouper:end groupby="16" count="{count}" total="{total_results}"}
            </ul>
        {/exp:grouper:end}
    {/exp:channel:entries}
</div>
<!-- -->
<div class="col-holder clearfix text-capitalize speakers-menu small-menu">
    {exp:channel:entries channel="speakers" dynamic="off" orderby="last_name" search:navigation_exclude="not y" sort="asc"}
        {exp:grouper:start groupby="45" count="{count}" total="{total_results}"}
            <ul class="list-unstyled">
        {/exp:grouper:start}
                <li><a href="{url_title_path='site/speaker'}">{title}</a></li>
        {exp:grouper:end groupby="45" count="{count}" total="{total_results}"}
            </ul>
        {/exp:grouper:end}
    {/exp:channel:entries}
</div>

```

**CSS:**

```
@media only screen and (max-width: 1023px) {
  .small-menu {
    display: block;
  }
  .large-menu {
    display: none;
  }

}
@media only screen and (min-width: 1024px) {
  .small-menu {
    display: none;
  }
  .large-menu {
    display: block;
  }
}

```

# Answer
Friend-o, the DOM viewport is **client side**.

http://detectmobilebrowsers.com

Using these scripts you can detect the user-agent header. This still won't tell you the viewport size, just if someone is on mobile.

To do exactly what you want, you'd have to write some JavaScript to watch the viewport size and then rebuild your channel entries loop with ajax. This will help:

https://stackoverflow.com/questions/13138100/loading-entries-in-expressionengine-with-ajax
> 1 votes

---
Tags: channel-entries, list
---


title: Wygwam not loading

text:
# Question
Title: Wygwam not loading
Updated EE v2.10.1 and using Wygwam v3.3.3 I have it set to initialize on click, and can see the field and all the content correctly. Clicking on the field makes it completely disappear.

Doesn't appear to be any errors(?).

Thought it may related to Channel Images but it appears the CI plugin for Wygwam is incorporated in the dl.

Any help is appreciated.

# Answer
> 1 votes
Have you updated Channel Images addon as well? Have you checked your developer console to see your JavaScript errors? It is almost certainly a 404 (like @balloonatic said), a JavaScript conflict, or an un-updated addon in general.

---
Tags: pixelandtonic, wygwam
---


# Question
Title: Looking for print_r or var_dump equiv for channel:entries row
I'm new to expressionengine, and am looking to understand the channel:entries loop better. In the interest of that, I've been looking for something that allows me to print\_r or var\_dump a channel:entries structure as a whole, and a given row of that structure, like:

```
// Note that this is certainly not correct ee syntax, but rather a plain php representation of what I'm trying to do:
$results = {channel:entries};
print_r($results); // Show members of the channel:entries tag.

foreach ($results as $row) {
    print_r($row); // Show members of a single row of the result set.
}

```

Clarification: in no way am I attempting to output any of this information to a page -- this is merely an attempt to better understand the data contained in a row, so I can make better use of this project I've inherited.

# Answer
OK, I understand what you're asking, but it doesn't primarily make sense in context to a Channel Entries loop and the EE Template Parsing engine. However, I believe you really are looking for something like this:

```
{!--
This is my template
It has PHP Parsing set to `Output`
--}

<!-- This is our Channel Entries loop, outputting the last 10 entries -->
{exp:channel:entries channel="news" limit="10"}

    <h1>
        <!-- Output this entry's title -->
        {title}
    </h1>

    <?php
    // Hrmmm.. what do we have here?
    var_dump("{title}");
    ?>

{/exp:channel:entries}

```

If you really gotta do things the way you're asking, you can, but it's seriously pointless and overkill (If you're developing for someone, and they don't let your EE Member view channel fields groups \[which will tell you your exact information for that channel, minus the default info that goes with every channel entry\], friggin' quit. They are awful).

If you really need more information, go to the EE docs and browse, but the only other answer is to use MySQL to query the database for a channel entries information. And in that case, why use EE at all if you're going to write your own queries?

**Edit**

Dude, it's all here:

https://ellislab.com/expressionengine/user-guide/add-ons/channel/channel\_entries.html
> 1 votes

---
Tags: php, debugging
---


# Question
Title: Searching and Form submissions Duplicating site URL
Having an issue with a site duplicating its base URL during a search result or a form submission.

ie: After searching for a term or phrase I receive the following: http://www.domain.com/http://www.domain.com/search/...

Below is a snipet of code which outputs the search form.

```
    <div id="search_box">
        {exp:search:simple_form channel="pages|languages|staff|video" result_page="search/index" search_in="everywhere" results="20" where="all"}
        <input id="search_box_input" name="keywords" type="text" onClick="if(this.value=='search for articles, news, videos, and more') this.value = ''" onBlur="if(this.value=='') this.value = 'search for articles, news, videos, and more'" value="search for articles, news, videos, and more" />
        <input type="image" src="{site_url}/img/bt_search.png" id="search_button" name="submit" alt="Submit Search" />
        {/exp:search:simple_form}
    </div>

```

# Answer
> 0 votes
Try changing this parameter:

```
result_page="search/index"

```

to this:

```
result_page="{site_url}search/index"

```

You may need to add a slash after `{site_url}` depending on what that var is set as.

---
Tags: site-url
---


# Question
Title: Multisite - Create New Site Button Not Appearing
We were recently having issues with MSM in ExpressionEngine, and we were told that we had the wrong version of MSM for our version of ExpressionEngine. We are running version 2.5.5. We were told to contact ExpressionEngine to get a version of MSM that would work with our build. We were sent MSM 2.1.4, the installation went well, and I am able to click on the Edit Sites button and get to the Edit Sites page. However while on this page, the Create New Site button does not display. I'm not sure what the issue is.

# Answer
This may seem an obvious question, but have you reached the maximum number of MSM site licences you have purchased with Expression Engine?

Each time you purchase an extra site licence, the MSM package you download from EllisLab contains the file *system/expressionengine/libraries/Sites.php*.

This PHP file contains three hashes: *$num\_sites\_allowed*, *$the\_sites\_allowed* and *$sites\_allowed\_num* which are referenced by the MSM module - no doubt removing the "Create New Site" button if the wrong Sites.php file is used in the installation.

If you do have enough licenses purchased, then it's just a case of copying Sites.php from your old MSM installation (or downloading a package of the MSM again from you Ellislab account and extracting it manually) and replacing it.
> 0 votes

---
Tags: multi-site-manager
---


title: Free Form Pro File Upload File Name

text:
# Question
Title: Free Form Pro File Upload File Name
Is it possible to replace/prepend the file name on upload with some member data?

For example original file is called file\_data.zip but then prepend the filename with third\_hyperion\_991 leaving third\_hyperion\_991\_file\_data.zip

# Answer
> 0 votes
https://ellislab.com/expressionengine/user-guide/development/extension\_hooks/global/filemanager/index.html#file-after-save

http://php.net/manual/en/function.rename.php

Suggestion: Use the `file_after_save` hook to simply rename the file in a custom extension. You will then have to update the related file info in the database (and probably where it's connections live in your channel data rows).

This assumes you are using a native file field in FreeForm. If you're using an assets field, the hook might be different. If using assets, one of these suckers will be your prize:

http://docs.pixelandtonic.com/assets/developers/hooks/index.html

---
Tags: solspace-freeform
---


# Question
Title: Stash Shortcodes - last one outputs "home"
EE 2.10.1 Stash 2.6.5

I'm trying to set up some shortcodes using Stash on a rebuild of my site where I formally was using MX Jumper to do the same thing.

The code works fine except that the last instance of the shortcode always outputs `home` on the front end inexplicably

My code is where {code\_sample} is a grid field:

```
{!--
    //Stashing code blocks to inject into blog_copy
--}

{code_sample}
    {exp:stash:set name="code_block_{code_sample:count}" type="snippet"}

            {code_sample:code}

     {/exp:stash:set}
{/code_sample}

{!--
    //End Stashing code blocks
--}

```

Then further down the template:

```
{exp:stash:parse process="end"}
    {blog_copy}
{/exp:stash:parse}

```

If there is more than one code block then the final code block always renders as `home`.

Any thoughts?

--------update---------

Template debugging shows this as the final output, which is correct but still on the front end it displays "home"

```
(0.195359 / 8.31MB) Stash: SET code_block_9 to value {exp:ee_syntax:filter} <pre lang="php" line="3257"> $field_id = $this->get_field_id($field_name); ee()->api_channel_fields->apply('_init', array(array( 'row' => $this->entry, 'content_id' => $this->entry('entry_id'), 'field_id' => $field_id ))); </pre> {/exp:ee_syntax:filter}

```

Also if I put this code in the template without stash all grid rows are output correctly

```
{code_sample}

        {exp:ee_syntax:filter}
            {code_sample:code}
        {/exp:ee_syntax:filter}

        <br><br><br>

{/code_sample}

```

-----end update-------

-----update 2-------

Working with a new template with nothing in it but the layout tag and channel entries I have determined that this stash code does not play well when passing variables through the layout tag like this:

```
{layout="site/_layout" body_id="home"}

```

or

```
{layout:set name="body_id"}blog{/layout:set}

```

Using either of those results in the final code block outputting whatever is being passed through in the layout tag. Changing the passed variable name doesn't fix this issue either. Not sure if this is a Stash bug or an EE bug or both...

-----end update 2-------

# Answer
This turned out to be a bug in the Template class:

https://support.ellislab.com/bugs/detail/21054
> 2 votes

---
Tags: stash, template-scripting
---


title: Low Seg2Cat and MixItUp

text:
# Question
Title: Low Seg2Cat and MixItUp
I have a bakery site that uses Switchee to use a single template to serve up multiple "pages", the content of each case is a snippet.

On my order page, I have channel entries products whose categories are being filtered by using the jQuery plugin MixItUp. This is working fine, but when I want to send a "deep link" to the order page to display ONLY the category in a URL hash

```
http://www.example.com/order#cakes

```

I cannot figure out for the life of me how to make this work. My js code in the footer is as such:

```
<script>
$(document).ready(function(){

    // check if there is a url hash, and if so,
    // save it as a variable and prepend a '.' to the start - e.g. '.blue'
    // else, set variable as the default "all"

    var filterOnLoad = window.location.hash ? '.'+window.location.hash : 'all';

    // Instantiate MixItUp:
    $('#Container').mixItUp();
    load: {
            filter: filterOnLoad
        };
    controls: {
            activeClass: 'favorite-filter'
        };
    animation: {
            enable: 'true'
            effects: 'stagger'

        };
});

```

Which is code that I got from the MixItUp forums for using this technique in a general sense. I'm wondering if it is possible to use Low Seg2Cat after a hash? Here is my template code inside this snippet:

```
<div class="w-section content">
<div class="w-container">
    <h1 class="h1-order">Order</h1>
    {exp:low_variables:single var="lv_disclaimer_turnaround"}
    <div class="order-filter">
        <!-- <a class="filter-link favorite-filter" href="#">Best Sellers</a> -->

        {exp:channel:categories category_group="1" style="linear" sort="asc"}
        <div class="filter-link filter" data-filter=".{category_url_title}">{category_name}</div>
        {/exp:channel:categories}
        <div class="filter-link filter" data-filter="all">All</div>
    </div>

    <div id="Container">
            {exp:channel:entries
                channel="products"
                disable="category_fields|member_data|pagination"
                limit="200"
                orderby="random"
                sort="random"
                status="Open"
            }

                    <a class="w-inline-block tn mix {categories backspace='1'}{category_url_title} {/categories}" href="/order/{url_title}/">{if gluten_free == "no"}{if:else}<img class="gluten-free" src="/assets/images/gluten-free.svg">{/if}{if product_favorite == "no"}{if:else}<img class="favorite" src="/assets/images/favorite.svg">{/if}{exp:channel_images:images entry_id="{entry_id}"}<img src="{image:url:thumb}" alt="{title} - {site_name}" class="tn-img">{/exp:channel_images:images}
                        <div>{title}</div>
                    </a>

            {/exp:channel:entries}
    </div>
</div>

```

Any suggestions as to how to achieve this or where I'm fumbling?

# Answer
In short: no. Low Seg2Cat looks at full segments, which in your example is `order#cakes`, not `order`, nor `cakes`.

Your better bet is to, rather than use a hash in your URL to indicate a filter, simply append the `category_url_title` as a new segment. So, link your filters to `order/{category_url_title}`, and then manually change your URL to that link when your MixItUp filters are clicked. (You could even use the History API to do this and preserve back/forward states in the browser.)

That way your URLs can load fine without JS by using the standard Low Seg2Cat behaviour, e.g.,

```
 {exp:channel:entries
            channel="products"
            disable="category_fields|member_data|pagination"
            limit="200"
            orderby="random"
            status="Open"
            {if segment_2_category_id}category="{segment_2_category_id}"{/if}
        }

```

(You could then also remove your check for the existing filter in the URL in your JS.)

You'd also want to check for the existing category segment to apply whatever "active" classes you're using on your filter links.
> 1 votes

---
Tags: switchee, low-seg2cat
---


# Question
Title: Rating form is not giving any input fields
I have tried using standard example template given in Solspace website, its not giving any output other than saying no reviews message.

I have tried rating form tag within channel entries and outside, nothing has worked. In my settings i have allowed guest review as well.

Any idea of what s that missing in my approach. appreciate any help on this.

# Answer
> 0 votes
New to this add-on as well and was having the same problem with the example code for the exp:rating:comment\_form, couldn't get it to show up, but then started to realize that their larger blocks of example code have some errors, be sure to check the closing tags and syntax against the tag specific examples. Also be sure to enable all users and your intended channel in the Ratings add-on preferences, hopefully this helps.

---
Tags: solspace-rating, comment-form
---


# Question
Title: What file holds the "Invalid username" message?
In trying to prevent username enumeration, I'm editing login messages to obfuscate whether the username or password was incorrect. I've successfully edited the messages for when the password is wrong, but I cannot track down where the "Invalid username" message pictured below is stored.

I've edited `myaccount_lang.php`, but it's had no effect on this output. I've searched for "Invalid username" on my `/system/` folder, and updated the message anywhere I've seen it, but to no success. (The only other file I found it in was `moblog_lang.php`, just to be clear.)

What am I missing?

# Answer
Take a look in system/expressionengine/language/english/login\_lang.php
> 0 votes

# Answer
Rather than hacking the core or using speciality templates, use Custom System Messages. It's great and super easy to use
> 0 votes

---
Tags: login, security, language
---


# Question
Title: Content Elements doesn't have a {count} variable
I wanted to insert a related-articles block after the n-th content element using stash. But it seems Content Elements doesn't provide a `{count}` variable in the elements loop.

# Answer
> 3 votes
I've added a `{ce_counter}` variable to the elements loop.

Open the `ft.content_elements.php` file and navigate to the `replace_tag` function.

Insert `$i_counter = 0;` just before the foreach `$data` loop.

In the loop, look for the `// Counter` section and add:

```
$i_counter++;
$tagdata_parsed = str_replace('{ce_counter}', $i_counter, $tagdata_parsed);

```

In the loop, look for the `// Parse varibles in conditions` sections and add `'ce_counter' => (int) $i_counter` as an extra array item.

Now you can use `{ce_counter}` as a variable in the loop.

---
Tags: content-elements, count
---


title: Credit information from uploaded image

text:
# Question
Title: Credit information from uploaded image
How can I pull back the {description} information from an uploaded image. Bearing in mind I'm pulling back an image manipulation of the original?

```
   <img src="{recipe-thumbnail:small}" alt="{description}"/>

```

# Answer
You need to use a tag pair for your image:

```
{recipe-thumbnail}
<img src="{url:small}" alt="{description}"/>
{/recipe-thumbnail}

```

You have a number of variables that can be used inside the tag such as:

{title} {description} {location} {credit}

See for the full list https://ellislab.com/expressionengine/user-guide/add-ons/channel/custom\_fields.html#variable-pair-usage
> 0 votes

---
Tags: file-uploads, image, file-manager
---


title: Search option for entire site?

text:
# Question
Title: Search option for entire site?
I would like to search the specific keyword in all fields of all channels in Expression Engine. As there is only one excerpt option for each channel, I couldn't apply it to all fields in channel. Any option available to make all channel fields marked as excerpt to search entire site?

# Answer
The field you choose per-channel to use as an excerpt only determines what will be used to generate the contents of the `{excerpt}` variable inside the `{exp:search:search_results}` tag. It has no effect on whether a field is actually searched by the module.

All fields from all channels can be included in search by setting the **Is field searchable?** option to **Yes** on that field's **Edit Field** screen.

Also make sure that you set the `search_in` parameter on the `{exp:search:simple_form}` tag to either `everywhere` or `entries`, as it defaults to only searching `titles`.
> 2 votes

# Answer
... You can make all fields searchable. Not just excerpts. If you go to your field group, and edit any particular field, you can just set this setting:

LOL, but set that settings to `Yes` and save the field group. TADA!
> 0 votes

# Answer
You can use most custom fields in search results:

```
{exp:search:search_results switch="resultRowOne|resultRowTwo"}
{custom_field_one}
{my_custom_field}
{/exp:search:search_results}

```

Bear in mind that if you are searching channels with different field groups you'll need to account for any custom field you want to show in the results.
> 0 votes

---
Tags: search
---


title: running 2 sites on 1 installation

text:
# Question
Title: running 2 sites on 1 installation
I'm going down the classic route of 2 sites within 1 install for a client who has a multi-lingual site with Transcribe.

For those not familiar with that approach, here's the background. What we're doing though is routing all foreign language content through different domains.

This approach kind of works but if, for example, I edit the home page template, the primary domain gets updated but the secondary doesn't.

I've narrowed this down to the template path. If I add

```
$assign_to_config['tmpl_file_basepath'] = '/Users/steven/Sites/ee/multilang.dev/public/assets/templates';

```

to index.php on the secondary domain, it works as I'd expect. I edit the home page template and both sites update. My issue though is that the template path will change depending on the server configuration.

In the main config file, we're setting

```
$base_path = $_SERVER['DOCUMENT_ROOT'];
$config['tmpl_file_basepath']   = $base_path . "/../_templates/";

```

Any suggestions on how I can change the config to work across servers?

# Answer
> 1 votes
So the answer to this was actually simpler than I thought.

In `index.php` of the secondary site we set

`$base_path = $_SERVER['DOCUMENT_ROOT'];`

and then

`$assign_to_config['tmpl_file_basepath'] = $base_path . '/../../templates';`

I also had to do the same thing with the path to snippets & Low Variables.

---
Tags: templates, config, multilingual, config-overrides, multiple-sites
---


# Question
Title: How to get the member id on activation link click?
I'm trying to trigger some code in an extension when a new member clicks their activation link in the welcome email e.g domain/?ACT=171&id=oZYXwJfcAx

I can access the `authcode` using `$id = $this->EE->input->get_post('id');` and I can detect that the current hook is activation using:

`if ($this->EE->extensions->active_hook('member_register_validate_members') === TRUE){ ... }`

but I can't query the `exp_members` table for the `member_id` using the `auth_code` as it has already expired at this point.

Here's the query I'm trying to run:

```
    $id  = $this->EE->input->get_post('id');

    $this->EE->db->select('exp_members.member_id');
    $this->EE->db->where('exp_members.authcode =', '"' . $this->EE->db->escape_str($id) . '"', FALSE);
    $this->EE->db->limit(1);

    $query = $this->EE->db->get('exp_members');

    if ($query->num_rows() > 0)
    {
         foreach($query->result() as $row)
         {
             $member_id = $row->member_id;
         }
    }

```

I'm going around in circles on this so any help would be greatly appreciated.

Using EE 2.9.2 with MSM and Solspace User 3.5.0 installed.

# Answer
> 0 votes
`$member_id` should be available in the `member_register_validate_members` hook.
See EE's documentation about the `member_register_validate_members` hook.

You should be able to query the `exp_members` table with the `member_id` from the hook at hand.

---
Tags: extension, solspace-user, activation
---


# Question
Title: Freeform - required fields blank after errors
I'm using Freeform 4.2.0 and EE 2.8.1 . I've got the form below, with required fields. Freeform does recognise that the fields are required and returns the error messages, but any correctly filled out fields are blank. Is there a way to make freeform remember the correctly filled out fields when returning errors?

```
  {exp:freeform:form
    form_id="3"
    form_name="student_bookings"
    return="/student-accommodation/thank-you"
    notify_admin="yes"
    admin_notify="email@email.com"
    notify_user="yes"
    user_email_field="student_email"
    user_notification_template="student_user"
    inline_errors="yes" required="property_details|rent_agreed|deposit_agreed|room_type|student_name|student_address|student_tel_number|student_email
}

```

# Answer
Instead of using input fields like this:

```
<input type="text" class="your-class" name="FIELD_NAME" value="" placeholder="Enter FIELD_NAME" />

```

Use this:

```
{freeform:field:FIELD_NAME
    attr:class="your-class"
    attr:placeholder="Enter FIELD_NAME"
}

```
> 1 votes

---
Tags: solspace-freeform
---


# Question
Title: Problem with Expresso or Rich Text fields inside a Matrix inside a Low Variable
I have a Low Variable that is set as a Matrix field. Inside of my Matrix, I have a field set as an Expresso field. When I view the edit variable screen, the Expresso toolbar doesn't show up -- the field just appears to be a regular text field.

When I try to display my Low Variable field in a template, it displays the Expresso text unprocessed, as if it were a regular text field, and I get these php errors:

```
Message: Undefined property: Expresso_ft::$row
Filename: expresso/ft.expresso.php
Line Number: 389

Message: Undefined property: Expresso_ft::$row
Filename: expresso/ft.expresso.php
Line Number: 390

Message: Cannot modify header information - headers already sent by (output     started at /path/to/system/codeigniter/system/core/Exceptions.php:170)
Filename: core/Common.php
Line Number: 412

```

I have the same issue if I switch the field type from Expresso to Rich Text -- no editing buttons on the edit variable screen, and these php errors:

```
Message: Undefined index: field_fmt
Filename: libraries/Rte_lib.php
Line Number: 505

Message: Cannot modify header information - headers already sent by (output     started at /path/to/system/codeigniter/codeigniter/system/core/Exceptions.php:170)
Filename: core/Common.php
Line Number: 412

```

I don't have any problems using Matrix, Expresso or Rich Text fields as Low Variables individually, it's only when I nest the Expresso or RT fields inside a Matrix inside of a Low Variable.

I'm running EE 2.5.4, Low Variables 2.3.2, Matrix 2.5.2 and Expresso 3.0.2

# Answer
> 2 votes
I have run into this problem also. The developer of Expresso has indicated that this is not supported and might never be.

While I don't have a solution, I did some tests to see if any other "wysiwyg"-style fieldtypes support this. Here's what I found:

* Native RTE: No
* Expresso: No
* Wygwam: Yes
* Wyvern: Yes
* Redactee: Yes
* Editor (DevDemon): Yes

# Answer
> 0 votes
/system/expressionengine/modules/rte/libraries/Rte\_lib.php line 505

Instead of

if ($settings\['field\_fmt'\] == 'xhtml') { $this-\>EE-\>load-\>library('typography');

```
                $data = $this->EE->typography->_format_newlines($data);

                // Remove double paragraph tags
                $data = preg_replace("/(<\/?p>)\\1/is", "\\1", $data);
            }

```

you should check if isset this field. Like this.

if (isset($settings\['field\_fmt'\])) {

```
            if ($settings['field_fmt'] == 'xhtml')
            {
                $this->EE->load->library('typography');

                $data = $this->EE->typography->_format_newlines($data);

                // Remove double paragraph tags
                $data = preg_replace("/(<\/?p>)\\1/is", "\\1", $data);
            }
        }

```

---
Tags: matrix, expresso, low-variables, richtext, expresso-toolbar
---


title: Super Search isn't posting data

text:
# Question
Title: Super Search isn't posting data
I'm trying to debug why SuperSearch isn't posting the query string into the URL segment.

I have a document library search area (domain.com/library) that has with a number filters: article type, language, author, date range etc. If I select any one or combination of these and hit submit the returned page is the same as the originating one. SuperSearch doesn't post the selection into the URL, eg domain.com/library/search&authors=conan-doyle. It simply returns domain.com/library/

If on the other hand I manually type or follow pre-compiled links such as domain.com/library/search&authors=conan-doyle then the correct entries are filtered.

It was working previously. Then during a server migration I hit on some git versioning issues that resulted in me having to rollback a number commits. Even though none of the lost commits had anything, seemingly to do, with the SuperSearch forms.

Only SuperSearch's form submit isn't working. Other forms on the site (FreeForm, Newsletter sign ups) all work.

I've scoured EE's debug=on log a number of times and dug around in Chrome's developer tool. But nothing is calling out at me "here's the problem".

Does anyone have any suggestions as to how I may go about debugging the issue?

# Answer
I'm an idiot.

I had commented out the following htaccess rule:

```
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

```

And that simply broke Super Search. Once reinstated it and added the extra `?` in `RewriteRule ^(.*)$ /index.php?/$1 [L]`, because the new server runs php as FastCGI, then everything worked as expected.
> 0 votes

# Answer
It sounds like your `super_search:results` tag has the `redirect_post` parameter set to `no`.

> By default, Super Search will redirect a POST search to contain the search query in the URI on the results page, similar to how it does on Google searches, etc. This allows your users to bookmark search queries, etc. To override this behaviour, specify this parameter with a value of **no**.

(Docs.)
> 0 votes

---
Tags: forms, supersearch
---


# Question
Title: Can't Change Root Directory of Site using MSM
I have just gotten MSM installed and now I'm going through the necessary steps to setup the new site on the current server. I've uploaded a new index.php and a new admin.php file to the new directory. If I type in the URL to the admin.php it opens up the Control Panel for the new site. However if I use the URL to the directory of new sites index.php all I get is a white screen. Below are my index.php and admin.php files (I renamed the admin.php file)

```
**index.php**

$system_path = '../../system';

$assign_to_config['site_name']  = 'VOT';
$assign_to_config['cp_url'] = 'http://artisanscenterofvirginia.org/VOT/votadmin.php';
$assign_to_config['site_url'] = 'http://artisanscenterofvirginia.org/VOT/';

votadmin.php

$system_path = '../../system';

 $assign_to_config['site_name']  = 'VOT';
 $assign_to_config['cp_url'] = 'http://artisanscenterofvirginia.org/VOT/votadmin.php';

```

# Answer
Have you entered the site url in the Control Panel for your new site?

You will need to got to the new child site in the Control Panel and enter it here: Admin / General Configuration / URL to the root directory of your site
> 0 votes

---
Tags: multi-site-manager
---


title: Search results - Order by Date

text:
# Question
Title: Search results - Order by Date
We need to order our search results by relevance then post date, however I can't find any reference to order in the ellislab documentation:

https://ellislab.com/expressionengine/user-guide/add-ons/search/index.html

Is this even possible with the search module? If not can anyone recommend a third party addon that would allow us to do this?

Thanks!

# Answer
> 1 votes
Ehhh I struggled with this one an a previous project. If I remember correctly, there were a few options to do what you're looking for. First of all, these solutions came through Solspace Super Search.

First example is a little weird, but it's because I needed to create functionality that allowed people to search by dates in a various forms (like search for "September 1st" with no year, or "4/15/1880"). In your example, you could basically do this:

```
{exp:super_search:results
    paginate="bottom"
    {!-- other parameters --}
    limit="10"
    orderby="event_year|event_month|event_day"
    sort="asc|asc|asc"
    relevance="title=5+body=5"}

```

https://solspace.com/docs/super\_search/results/#orderby https://solspace.com/docs/super\_search/results/#relevance

According to the docs, it sorts by `relevance` first, and then when you have results with the same relevance, it orders by the `orderby` parameter.

I'm pretty sure you can just leave the `orderby` parameter blank, and it defaults to sorting by `entry_date`. So, set your relevance, and it'll order by `entry_date` after that.

If you're worried, force set like this (assuming ascending date order for equally relevant results):

```
    orderby="entry_date"
    sort="asc"

```

---
Tags: search, orderby
---


# Question
Title: Solspace iCalendar: how to download only one (e.g. next) occurrence of an event?
Is there a way to only add the next occurrence of an event to iCal using the icalendar tag?

I see the previous answers on how to do this with other calendar tags (cal, etc.), but I would appreciate any help specifically for an .ics file.

Thanks in advance! Misha

# Answer
If you mean how to do this using `{exp:calendar:icalendar}{/exp:calendar:icalendar}` (https://solspace.com/docs/calendar/icalendar/), unfortunately it's not possible. You can go as far as limiting export to a single event entry, but that will bring in all the info about the event, including its occurrences.

I suggest submitting this as a Feature Request under the specific add-on category at http://support.solspace.com/support/discussions. It'll also give other users the option to vote up the feature request, and help us prioritize features to add in upcoming versions of this add-on.
> 1 votes

---
Tags: solspace-calendar
---


# Question
Title: How can I create a link to display entries filtered by a channel field?
I need to create links to display job listings by 1) job type (a channel field) **or** 2) salary range (also a channel field). The salaries are single integers.

I also need to display the search above the results, for example, "Listings: Executive Jobs," or Listings: $75k to $85k Jobs."

I've struggled with this all day and can't find a solution. :(

Is this something that can be done natively within EE or do I need something like Low Search?

Any help would be greatly appreciated, thanks in advance.

# Answer
You can use `search:field_name` parameter to filter the entries. For job type, `search:job_type="=[JOB TYPE]"` for exact match.

For salary range, its needed if its numeric field so that you can use parameter like `search:numeric_field=">=20"` and `search:numeric_field="<=20"`

See documentation here.
> 1 votes

---
Tags: search, filter
---


# Question
Title: Cannot upload a photos (channel images) when using Channel Form
I am using channel form to create a new entry in my gallery and use {field:gallery\_images} to display the channel images field.

On the form when I try and click on the upload images button nothing happens.

```
{exp:clubmanager:club}
                     {exp:channel:form channel="gallery" return="clubhouse/gallery" class="sky-form" }
                        <input type="hidden" name="gallery_club" value="{club_name}">
                        <input type="hidden" name="gallery_club_url" value="{club_url_title}">
                    <fieldset>
                      <section>
                            <label class="label">Title</label>
                            <input type="text" name="title" id="title" value="{title}" size="50" maxlength="100" onkeyup="liveUrlTitle();">
                            <input type="hidden" name="url_title" id="url_title" value="{url_title}" maxlength="75" size="50">
                        </section>

                         </fieldset>

                           <fieldset>
                            <section>
                            <label class="label">Images</label>
                                {field:gallery_images}
                            </section>

                            </fieldset>

                            <footer>
                                <button type="submit" class="btn-u">Submit</button>
                            </footer>
                        {/exp:channel:form}
                        <!-- End Publish Report Form-->

             {/exp:clubmanager:club}

```

# Answer
> 0 votes
Not at a computer but it sounds like you are missing the JavaScript file needed to make it work. Use Show-EE submit form as an example.

---
Tags: safecracker, channel-images
---


# Question
Title: Embed variable as from or to date. Should this work
EE2.9.2, Low Nice Date 2.2.1

**Main template:**

```
{exp:zoo_visitor:details}
{embed="applications/_author-application-list"
    memberDob="{cf_stual_date_of_birth timezone='Europe/London'}"
    courseStartDateUnix="{exp:low_variables:single var="lv_course_start_ba_mt" format='%U'}"
    minimumAge="{lv_course_min_age_ba_mt}"
    }
{/exp:zoo_visitor:details}

```

{cf\_stual\_date\_of\_birth} is a DropDate custom field - Value: 5th March 1998 {lv\_course\_start\_ba\_mt} is a Low variable Time Date field - Value: 30th September 2015 {lv\_course\_min\_age\_ba\_mt} is a Low variable text field - Value: 21

I'm using an embed for other reasons. I've stripped lots of stuff out for this example.

**Embedded Template: applications/\_author\_application\_list**

```
{exp:low_nice_date:range from="{embed:memberDob}" to="{embed:courseStartDateUnix}"}
    <p>{years} / {embed:minimumAge}</p>
    {if "{years}" >= "{embed:minimumAge}"}
        <p>YES</p>
    {if:else}
        <p>NO</p>
    {/if}
{/exp:low_nice_date:range}

```

This returns:

```
<p>17 / 21</p>
<p>YES</p>

```

So it seems like the embed variables are working as the to and from values in the Low Nice Date tag but not in the conditional. Should this work? Is this a parse order issue? Any idea for a workaround?

I have tried using the CC Time Difference add-on as well but I ran into some other issues with that. This is the closest I've got to a working solution.

# Answer
> 0 votes
It was a parse order issue and switching on **Early Parsing** in Low Variables for **{lv\_course\_min\_age\_ba\_mt}** has fixed it.

Woot!

---
Tags: low, low-nice-date
---


title: Pagination Class in Third Party Module

text:
# Question
Title: Pagination Class in Third Party Module
I'm new to EE and I'm having problems using the Pagination Class. I've created a custom module and have the following method in my mod file. The pagination is rendering on the template fine and the URLs look fine (mydomain/series/pagination\_test/P24) but the results are not changing as I navigate the pagination.

```
public function pagination_test() {

    $this->EE->load->library('pagination');
    $pagination = $this->EE->pagination->create();
    $this->EE->TMPL->tagdata = $pagination->prepare(ee()->TMPL->tagdata);
    $tagdata = $this->EE->TMPL->tagdata;
    $results = $this->EE->gt_model->pagination_test_data();

    foreach($results as $row)
    {
        $variables[] = array(
          'alt_title' => $row['alt_title']
          );
    }

    if ($pagination->paginate === TRUE)
    {
        $total_items = count($results);
        $per_page = ee()->TMPL->fetch_param('limit');
        $status = $pagination->build($total_items, $per_page);
    }

    $this->return_data = $this->EE->TMPL->parse_variables( $tagdata, $variables );
    $this->return_data = $pagination->render($this->return_data);

    return $this->return_data;
}

```

# Answer
> 1 votes
The step you're missing is actually filtering your query/dataset by the `offset` generated by the Pagination class. (Usually this is used inside a database query, but you can also just use it to slice your array.)

```
if ($pagination->paginate === TRUE)
{
    $total_items = count($results);
    $per_page = ee()->TMPL->fetch_param('limit');
    $pagination->build($total_items, $per_page);

    // The important bit
    $variables = array_slice($variables, $pagination->offset, $per_page);
}

```

---
Tags: pagination
---


title: Expresso Store Shipping Required?

text:
# Question
Title: Expresso Store Shipping Required?
My site does not have any items that will be shipped. I have no shipping methods set up. I have no shipping fields present in the checkout. The orders won't submit, and the error messages I'm getting all say "Shipping First Name Required.The Shipping Address 1 field is required. The Shipping City field is required.

What's my fatal flaw?

# Answer
> 0 votes
Store does not require shipping details to complete checkout.

It is hard to say for sure without seeing your template code but you will want to look at your checkout templates and make sure that you don't have `required="name|address1"` and any additional fields that are returning required. Using the shorthand "name" instead of "billing\_name" would require both shipping and billing names be filled out. The docs have more details on required fields.

You might also check in your Store \> Settings \> General that you have the Default Shipping Address set to none and not "Billing same as Shipping Address"

---
Tags: expresso-store
---