3 of 3
3
Extension: MD Simple Relation. Creates a “simple” relationship field, storing only the entry_id.
Posted: 08 May 2009 09:29 AM   [ Ignore ]   [ # 37 ]  
Lab Assistant
RankRank
Total Posts:  126
Joined  04-03-2008

Your extension solved a major problem for me, so thanks for that.

It initially worked perfectly, but now something weird is happening.

Entries that were already working are still fine, but new entries don’t bring back the related gallery. After looking into it, I’ve found that the field is returned with line breaks, rather than just as an integer.

Doing this in the template:
'{rel_image}'
Yields:
'

2

instead of:
'2' 

The edit form looks ok:

<option value='4'>Stepping Down</option>
<
option value='1'>Spring 2009</option

Any thoughts on what would cause that to happen?

Thanks again, because aside from this new issue, this extension has made me very happy!

Profile
 
 
Posted: 08 May 2009 09:51 AM   [ Ignore ]   [ # 38 ]  
Lab Assistant
RankRank
Total Posts:  126
Joined  04-03-2008

Update: it’s actually outputting

'<p>2 </p>' 

So, now at least I can strip that part out with php, but it’s still weird.

Profile
 
 
Posted: 08 May 2009 10:34 AM   [ Ignore ]   [ # 39 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1757
Joined  03-26-2006

Can you confirm my suspicion that you probably recently upgraded from a pre 1.6.5 version of EE to 1.6.5+?

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 08 May 2009 10:43 AM   [ Ignore ]   [ # 40 ]  
Lab Assistant
RankRank
Total Posts:  126
Joined  04-03-2008

Hi,
I’m on 1.6.7, but I only installed your extension two days ago, so the system hasn’t changed since then…

My latest attempt was to strip out the html and trim the field, then plug that into the gallery tag:

{assign_variable:images="{exp:html_strip}{rel_image}{/exp:html_strip}"}
Check what I
've got: '{images}'
{if rel_image}
{exp:gallery:entries gallery="my_gallery" category="{images}"} 

I expected that to work, but it’s still a no go.

Thanks,
Matt

Profile
 
 
Posted: 08 May 2009 11:12 AM   [ Ignore ]   [ # 41 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1757
Joined  03-26-2006

Well, it’s probably a problem with the extension. I’m fairly certain I developed this before 1.6.5 or am not explicitly setting the field formatting.

The issue is outlined in this devot:ee article on field formatting, and what you can do in the meantime to most likely fix this is:

1) Right around line 390 you’ll see: $r .= $DSP->input_select_footer();. Add the following line (per the article) directly after that:

$r .= $DSP->input_hidden('field_ft_' $row['field_id']$row['field_fmt']); 

If you had existing entries where this became a problem, you may need to pay special attention to the “One More Thing” section of that article to “reset” those entries. Let me know if that helps.

I just updated the extension at GitHub with this line as well.

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 08 May 2009 11:21 AM   [ Ignore ]   [ # 42 ]  
Lab Assistant
RankRank
Total Posts:  126
Joined  04-03-2008

That did the trick!

Thanks so much.
Matt

Profile
 
 
Posted: 08 May 2009 10:53 PM   [ Ignore ]   [ # 43 ]  
Summer Student
Total Posts:  1
Joined  04-20-2009
mdesign - 08 May 2009 03:12 PM

If you had existing entries where this became a problem, you may need to pay special attention to the “One More Thing” section of that article to “reset” those entries. Let me know if that helps.

Thanks so much, Ryan. I’m working on my first EE site, and I’ve been using your MD Simple Relation extension. I was taking the value from my Simple Relation field and doing a query to find the original entry it was related to. I’ll just say that it’s hard to find an entry_id with a value of something like this:

<p>7</p

wink If I couldn’t get the problem fixed, I was going to have to go back to trying to do embedded related_entries and reverse_related_entries with multiple embedded templates. Nasty. You can imagine my excitement when I saw the posts on this thread today.

Also, while pulling out my hair the past couple of weeks with this issue, I figured out the “One More Thing” step before seeing your link to the devot:ee article. I was doing this every time I would post a new entry in order to remove the [p][/p] tags.

Here are the steps I used to fix the existing entries each time I posted a new one:
1) While editing the custom field, change the Field Type from MD Simple Relation to something like Text Input (otherwise you’ll see “Text formatting is not available for your chosen field type.”)
2) You probably ultimately want to set the formatting to be None. In order to force the update of existing entries, set it to XHTML for now. 
3) You should now see the checkbox at the bottom of the page to “Update all existing weblog entries with your new formatting choice?” Check this box.
4) Warning: When you click Update in the next step, you will lose your relationship settings. So I would recommend you note down all of the settings so you can change them back later. (You might be able to actually change the type back to MD Simple Relation before clicking Update so you don’t lose your settings. It didn’t seem to actually set it to XHTML when I did this though.)
5) Click Update to change all the entries to XHTML format.
6) Now go back to edit the field again. This time set the Text Formatting to None. Change the Field Type back to MD Simple Relation. Re-enter the relationship settings (weblog, display order, etc.)
7) Check the “Update all existing weblog entries” checkbox again to remove the tags from all your existing entries.
8) Click Update.

I’m not sure if any of that made sense… it’s kind of hard to describe. Hopefully this will be useful to someone.


Thanks!
Josh

Profile
 
 
Posted: 08 May 2009 10:55 PM   [ Ignore ]   [ # 44 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1757
Joined  03-26-2006

Wow. Hopefully we saved you some serious time by just fixing the extension!

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 01 November 2009 10:38 AM   [ Ignore ]   [ # 45 ]  
Lab Assistant
RankRank
Total Posts:  133
Joined  05-31-2005

Hm, the plugin is not working for me.

I’ve installed it on 1.6.8, build 20091002, but I am getting strange tag code parsed in my template:

{REL[field_name]RIXjGqUxREL} (random chars at the end on a refresh)

When I change the custom field to a “normal” relationship type (from EE) instead of the MD Simple Relation, it works perfectly.

Anyone got an idea?

Profile
 
 
Posted: 01 November 2009 11:06 AM   [ Ignore ]   [ # 46 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1757
Joined  03-26-2006

Well, you can’t use {related_entries} tags with this at all. The point of this add-on was to avoid the relationship table. If you need a regular relationship, just use the regular relationship field type. See my use case in this thread.

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 01 November 2009 11:17 AM   [ Ignore ]   [ # 47 ]  
Lab Assistant
RankRank
Total Posts:  133
Joined  05-31-2005

ah I see. Couldn’t find the instructions on how to use it, so that’s why I thought I had to use the default tags. Maybe it’s a good idea to add the instructions to the plugin download! smile

Thanks!

Profile
 
 
Posted: 01 November 2009 11:19 AM   [ Ignore ]   [ # 48 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1757
Joined  03-26-2006

You’re right about adding instructions. Sorry it wasn’t clear!

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 25 November 2009 07:10 PM   [ Ignore ]   [ # 49 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  229
Joined  11-16-2004

Ryan - doh. I just lost half a day fighting with this. Apparently the extra line you noted above to fix the field formatting was not present in the GitHub version as of the writing of this post. However, I was able to add it and now all is well.

Thanks!

 Signature 

T. Payton
OneCreative | Albuquerque, NM

Profile
 
 
Posted: 14 April 2010 07:40 AM   [ Ignore ]   [ # 50 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  414
Joined  03-07-2007

Small bug found. Relating to a weblog and sorting by date ascending, still gets ordered by title.
Around line 358 change

if ($row[“field_related_sort”] == “date”) {
    $sort = “entry_date”;
  }
to
if ($row[“field_related_orderby”] == “date”) {
    $sort = “entry_date”;
  }

Profile
 
 
Posted: 12 July 2010 11:48 AM   [ Ignore ]   [ # 51 ]  
Grad Student
Avatar
Rank
Total Posts:  76
Joined  06-16-2008

Things seem to have died down on this but I’m wondering if this extension will allow me to present a list of entries the user has created. The scenario:

User A can post in weblog X.
User A can post in weblog Y.
When user A posts in weblog Y he/she can see a list of their posts (in a drop-down) in weblog X. User A can then select from that list to create a relationship.

Of course, all this needs to be done within an SAEF.

I think the answer to this question is “not possible” but Playa can’t do this (yet) so I’m stuck unless I can find something.

 Signature 

Stephen Van Esch

Message Rocket

EE-powered sites: EdibleExperiment | GreenIndex

Profile
 
 
Posted: 12 July 2010 12:02 PM   [ Ignore ]   [ # 52 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1757
Joined  03-26-2006

Well, just about anything is possible. You could probably do this with PHP, by checking for the logged-in user’s ID and populating a drop-down with entries from Weblog X where they are the author. You may not even need PHP. Perhaps something like the following would work:

<select name="field_id_00" id="field_id_00">
{exp:weblog:entries weblog="x" disable="categories|category_fields|pagination|trackbacks" dynamic="off" author="CURRENT_USER"}
<option value="{entry_id}">{title}</option>
{/exp:weblog:entries}
</select

You may have to embed that entries loop for it to work.

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

Profile
 
 
   
3 of 3
3