"* bad ref *" in layer path field

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
GaryC
Posts: 53
Joined: Tue Feb 03, 2015 1:02 pm

"* bad ref *" in layer path field

Post by GaryC »

We came across a problematic file where we had imported something by reference, and it was refusing to update. The series of steps was:

- Right click and choose "Update Layer Reference..."
- Nothing happens, so try right click and choose that again.
- We get a dialog saying that the original file is missing, so we're prompted to find it again
- However even after locating, nothing is updated and if we try "Update Layer Reference" this cycle repeats.

The curious thing is that right clicking and using "Locate Original Layer" works just fine. It finds the correct layer in the correct file without any errors being raised.

I took a look at the JSON in the mohoproj file inside and found these values:

Code: Select all

      "layer_ref_path": "* bad ref *", 
      "layer_ref_fileref": {
        "relativeTo": "Absolute", 
        "path": "* bad ref *"
      }, 
That's verbatim what it says, so it seems like moho found the path to not be working at one point. The strange thing is that it seems to have just added this flag in place of the path. And now it seems that it's causing a strange bug.

Can anyone illuminate a bit about what's going on here? What the cause might be and how to avoid it?
For reference, by removing this value and replacing with the actual path, referencing worked fine again.
User avatar
hayasidist
Posts: 3492
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: "* bad ref *" in layer path field

Post by hayasidist »

I had this a while back... I'd reorganised the directory structure for the work and the references fell to bits. I too fixed it with a manual edit of the mohoproj file. Mantis 39188 is indirectly related.
Post Reply