averyvery / freebie Goto Github PK
View Code? Open in Web Editor NEWEE 2.0 extension for ignoring specific segments when routing
EE 2.0 extension for ignoring specific segments when routing
This was due to an unrelated DB issue, the problem is solved...
Hello, attempting to install Freebie I get the following error. Any ideas? #10211 would be the next entry ID in exp_extensions...
EE v2.5.2 - Build Date: 20120606
A Database Error Occurred
Error Number: 1062
Duplicate entry '10211' for key 'PRIMARY'
INSERT INTO exp_extensions
(class
, hook
, method
, settings
, priority
, version
, enabled
) VALUES ('Freebie_ext', 'sessions_start', 'Freebie_ext', 'a:6:{s:9:"to_ignore";s:21:"success|error|preview";s:13:"ignore_beyond";s:0:"";s:14:"break_category";s:2:"no";s:14:"remove_numbers";s:2:"no";s:12:"always_parse";s:0:"";s:23:"always_parse_pagination";s:2:"no";}', 10, '0.2', 'y')
Filename: third_party/freebie/ext.freebie.php
Line Number: 388
Thanks!
I can ignore numbers in the URL but how can I check to see if the URL contains numbers in the template?
With Freebie, Structure isn't respecting the Channel listing template (the detail page) so I have to create a list of conditionals in the main template.
Would it be possible to provide a non-ssl feed (e.g. through gh-pages for example). Git hub redirects all requests to SSL which is okay in most instances. However, SSL can cause issues when PHP is not configured with SSL or SSL cert issues arise.
Hi Doug,
I'm not sure if this is an issue or a feature request! :)
In Structure, I have this page: /blog/tags/, which outputs a list of all the tags used in a blog.
I've created a breaking segment of tags as I want to use segment 3 in order to load a page of entries that contain that tag.
So /blog/tags/flowers/ should load a page with a list of entries that have a tag of flowers. This works fine on its own and is the point at which I tweeted a thanks to you earlier, as it wasn't working in an older version (maybe 2-3 versions back) of Freebie! :)
But I'm having problems when I want to use a single template to output one piece of content to /blog/tags/ and another piece of content to /blog/tags/flowers/, using conditionals. Further investigation has shown me why (I think).
On this page: /blog/tags/
The following code:
Outputs this:
Segment 2: tags
Segment 3:
Freebie 2: tags
Freebie 3: {freebie_3}
Should, or could the Freebie 3 segment above get outputted as a blank value at all, instead of {freebie_3}? If so, it'd certainly help me in this situation as I want to display content based on {if "{freebie_3}" == ""}Show this{/if}.
For information, on this page: /blog/tags/flowers/, the same code above outputs the following:
Segment 2: tags
Segment 3:
Freebie 2: tags
Freebie 3: flowers
which is exactly as I was expecting.
I hope this makes sense, and sorry if I'm going around the block to explain something or missing something.
Thanks,
Stephen
First off, this addon is awesome, thank you for this!
One small issue I ran into is when running multiple sites the plugin tag for category id may grab the wrong id if two categories in different sites have the same url title. Might I suggest adding a site id match to the mysql query - something along the lines of:
AND 'site_id' = '".$this->EE->config->item('site_id')."'
Thanks again for sharing this great addon!
Got this error when also submitting some post variables. I didn't look into the exact cause, but from where the code is breaking it looks like there is an assumption that the regular expression generates more than one "match" in the $matches variable. I wrapped the for each in an if to check that there are indeed matches.
Starting the line after "preg_match( $get_pattern, $to_match, $matches);" (136), I added this
if(count($matches)){
$get_vars_unparsed = substr( $matches[0], 1 );
$get_vars_parsed = explode('&', $get_vars_unparsed);
foreach($get_vars_parsed as $var) {
$var = explode('=', $var);
$key = $var[0];
$val = ( isset( $var[1] ) ) ? $var[1] : true;
$_GET[$key] = $val;
}
I know freebie is set up as it returns the category ID and category name outside the channel entries tag. If i substitue an actual category number for the {exp:freebie:category_id segment='4'} I get the list of products in that category.
My code:
<ul>
{exp:channel:entries channel="lumber_products" category="{exp:freebie:category_id segment='4'}" parse="inward"}
<li><a href="{path='lumber/products'}/{freebie_4}/{category_url_title}/{url_title}">{title}</a></li>
{/exp:channel:entries}
</ul>
This returns
Products in Category 2-Industrial Commercial and Agricultural
and then a blank page.
I am new to structure and freebie, but have several EE2 sites.
Hi there,
I've just upgraded my second site from Freebie 0.1.3.3 to 0.1.3.4, and each time, I've had the following PHP errors in the control panel:
A PHP Error was encountered
Severity: Notice
Message: Undefined index: always_parse_pagination
Filename: freebie/ext.freebie.php
Line Number: 83
A PHP Error was encountered
Severity: Notice
Message: Undefined index: always_parse_pagination
Filename: freebie/ext.freebie.php
Line Number: 246
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /home/my_account/public_html/my_system/codeigniter/system/core/Exceptions.php:170)
Filename: libraries/Functions.php
Line Number: 767
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /home/my_account/public_html/my_system/codeigniter/system/core/Exceptions.php:170)
Filename: libraries/Functions.php
Line Number: 393
I couldn't to access any of the control panel without deleting the Freebie row in exp_extensions. After doing this, I was able to access the control panel again. I then installed Freebie again and it worked fine.
Just thought I'd let you know in case it isn't just happening to my installation.
Thanks,
Stephen
Any plans to support EE3?
Not sure how or why but even with "search" included in the "Always Parse" area, pagination doesn't work. I disabled Freebie and Super Search worked as advertised!
There seems to be a bug when using {exp:freebie:category_id segment='4'} in channel tag in a specific case.
If the tag {exp:freebie:category_id segment='4'} is used anywhere in the template before using it in the channel tag ( {exp:channel:entries channel="listing-channel-name" category="{exp:freebie:category_id segment='4'}" dynamic="no" parse="inward"} ), the category parameter value is parsed into something cryptic.
The template debug output shows the following:
Tag: {exp:channel:entries channel="blog" category="M00o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr" dynamic="no" parse="inward"}.
Removing the occurence of this tag earlier in the template gives the following (correct) debug output:
(0.023463 / 11.06MB) Tag: {exp:channel:entries channel="blog" category="{exp:freebie:category_id segment='3'}" dynamic="no" parse="inward"}.
Hi.
We're getting a warning:
A PHP Error was encountered
Severity: Warning
Message: preg_match(): Unknown modifier ')'
Filename: freebie/ext.freebie.php
Line Number: 292
This is on php 5.3.3.
Would also be nice if this worked with Low's Seg2Cat. Perhaps a new Freebie variable that returns the category id etc of a specific variable?
Alternatively allow Seg2Cat to parse the URL before Freebie hides it from everyone!
Hey Doug,
I'm having some trouble that appears to be caused by Freebie: it causes ACT=xxxxx URL's to only function when uri_protocol is set to PATH_INFO, which isn't a possibility on one of the servers I'm developing a client-site for. According to EL this is because Freebie changes some core-behavior (this caused a major collision in SafeCracker in EE2.2)... Any way to fix this?
Thnx,
Steven
I'm getting this error after I updated the EE to 2.8.1 and extension to the current version
Message: Invalid EE Conditional Variable: {if "exp:freebie:any name="thanks"}
Filename: libraries/Functions.php
Line Number: 2640
When using freebie with Multi Site Manager it sometimes grabs the wrong category ID when using {exp:freebie:category_id}. I have the same categories in all sites and the plugin shows only the ID of the most recently created site.
Hi Doug,
First of all, thanks for porting the Safe Segments addon to EE2, then expanding on it further. Looks like a must-have addon for anyone who uses Structure! :)
I've just installed this on EE 2.1.0 Build 20100720, with Structure 2.1.3, but have came across an issue.
When freebie is installed (and without me entering any segments into the Extension settings), I noticed that it seems to cause all segments after segment_1 to be ignored - I tested this in a blank template with the following code (using various segment names in case anything was a reserved word):
{if segment_1 == "testtemplate"}Segment 1 works fine if you see this.{/if}
{if segment_2 == "second"}Segment 2 works fine if you see this.{/if}
{if segment_3 == "third"}Segment 3 works fine if you see this.{/if}
...(and so on)
When Freebie is installed, only the segment_1 line is outputted. When Freebie is disabled, all the segments output fine.
In a Structure template, I found that going to /blog/ worked as normal. But going to /blog/anything-else/ kept loading /blog/ regardless of whether there was a Structure entry or not, and regardless of whether I had segment conditionals within my template code.
This is a repeatable issue for me that comes and goes when I install/disable Freebie, but I've only had time to test it on a single install at the moment.
Please let em know what you think or whether you can think of anything I could be doing wrong/missing out to cause this to happen.
Thanks,
Stephen
When installing Freebie on a site running Solspace's Super Search module, the search queries used by Super Search no longer will work and throw an error message: "The URI you submitted has disallowed characters."
A typical search query look like this:
http://mydomain.com/search/search & keywords=foo+bar
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.