Search

I have the following situation:

I have multiple companies and multiple diciplines they work with.

A company can have multiple diciplines and a dicipline can have multiple companies.

What I am trying to achieve here: if I create/edit a company and select the diciplines (with a multiselect-field for example) they get linked. When I edit a dicipline, I can select which company applies for that dicipline. Adding or removing a company or dicipline from the multiselectbox automaticly makes sure the link is gone. So if I de-select a company on a dicipline-publish-page, the dicipline isn’t checked on the company-publish-page.

I know this can be done with the bi-link field, but it doesn’t seem to be maintained (and it gives me database errors which make me kinda scared).

Can the above be done with the Select Box Link Field?

Can the above be done with the Select Box Link Field?

The relationship itself can: the SBL with “allow multiple” enabled achieves a link table between the two sections such that you have a many-to-many relationship. But unfortunately it doesn’t provide the UI “reflection” whereby the field is presented in both sections, and I believe this why Bi-Link was created.

What database errors do you receive? There aren’t massive differences to Symphony since the last version it worked with, so it should be fixable.

Well, the first time you add a bi-link to a section and save changes, you get the following SQL-error:

SELECT f.parent_section FROM `btr_fields` AS f WHERE f.id = LIMIT 1

I believe you get this because there isn’t a second section with a bi-link field (which is logical, but the script should catch this error)

Secondly, the script throws sometimes PHP errors like

The second argument should be either an array or an object
...fields/field.bilink.php around line 421

and

Wrong datatype for second argument
...fields/field.bilink.php around line 301

Now I can fix some of these PHP errors, but I hope the functionality of this extension is still to be trusted after that, since I don’t know all the ins and outs of this extension.

Nevertheless it would be nice if this extension could get upgraded to Symphony 2.1.2, because it provides powerfull functionality!

Looks like the first issue has been fixed: http://getsymphony.com/download/extensions/issues/view/20063/3/

I wonder if other errors might be caused by a lack of a $ here. Is that even valid syntax?

https://github.com/rowan-lewis/bilinkfield/blob/master/fields/field.bilink.php#L422

I downloaded brendo’s legacy fork of Bi-Link, which seems to work better, without all the crashing and errors. That’s one of the drawbacks of GIT: sometimes a fork has ironed out most of the bugs, while the core extension itself (the one where this website points to) hasn’t been updated since 2009… :-(

@brendo: is the legacy-branch of your fork stable enough to work with?

Edit: Removed. Should have read the rest of the thread…

I wonder if other errors might be caused by a lack of a $ here. Is that even valid syntax?

I think you’re right there!

I put the pull request in (for the first error), but it hasn’t been committed :(

@kanduvisla, it should be relatively stable. The reason the fork was created was to maintain capability with a 2.0.6 site. It works okay, but it is very memory intensive. We’ve since tried to move away from the BiLink at work (in favour of Reference Link/Subsection Manager), which is why it’s development has pretty much halted.

@brendo: allright, I am going to use that fork then. If I run into any issues, I’ll just report them to you then ;-)

Is there scope for merging all of the changes and fixing up Bi-Link for good?

It works okay, but it is very memory intensive

Could you elaborate: anything specific we can try and address? I’m guessing this is with reference to the “Entries” mode in data source XML output, whereby it includes all fields and data of “child” linked entries?

In Rowan’s original repo it looks like:

  • master is very out of date
  • working is quite out of date
  • unstable is working plus one “major issue” patch
  • future is similar to unstable but has two subsequent commits (“Changes for future versions of Symphony” and the cryptic “Special changes”)

So getting an up to date version would be a case of taking the unstable branch and looking at the “major issue” commit, and the two additional commits from future. Assessing and merging these will be the latest version of Rowan’s repo.

And then there’s just the small task of merging this with Brendan’s legacy fork, and we’ll have one single Bi-Link field with all patches included.

Volunteers? ;-)

whereby it includes all fields and data of “child” linked entries?

I like how Nils handled this in the Subsection Manager, being able to choose which fields were output.

This may be a good addition?

From what I remember Rowan’s unstable/future branches added creating an entry for the linked section from the current section, similar to the very deprecated Subsection Field.

This was all around the timeframe of 2.0.7.

In terms of memory intensive, all the entries (and I believe fields and sections) are stored in static variables. Mind you, the section that has the legacy BiLink has 6 BiLinks from memory, all with around 200 links in each, so it may be an edge case (This is also a 2.0.6 install).

Cool. So you’re confident that your legacy branch is the most robust and stable? Anything from Rowan’s branches that should be merged?

I’ll gladly take a look and see if performance can be improved upon. Do static variables have a performance hit? I would have thought they are there for caching purposes to prevent re-querying?

Anything from Rowan’s branches that should be merged?

I couldn’t say, I only know the end goal he was shooting for and none of the changes in between. Hopefully he pipes up in this thread soon ;)

I’ll gladly take a look and see if performance can be improved upon. Do static variables have a performance hit? I would have thought they are there for caching purposes to prevent re-querying?

I don’t think static variables have a performance hit, quite the opposite infact. They are used how you suggested, to prevent re-querying for sections, fields and entries.

I downloaded brendo’s legacy fork of Bi-Link

I had to add the following line after line 300 or so because it was throwing an error when creating new entries using Symphony 2.1.2

if (!is_array($entry_ids)) $entry_ids = array();

Bi-Link Field updated to version 1.1.0 on 3rd of March 2011

Changelog

  • Fixed some minor issues.
  • Made compatible with Symphony 2.2.

As discussed above, does this latest version merge Rowan and Brendan's forks/branches?

Cool. So you’re [Brendan] confident that your legacy branch is the most robust and stable? Anything from Rowan’s branches that should be merged?

No, I basically updated it without being aware of Brendan's work, don't know how I managed that.

It doesn't have the caching optimisation that he added, but you can expect that to happen soon.

Cheers for clarifying. Bi-Link has a future still, so I'm glad :-)

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details