Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing full associations for single weblink #349

Merged
merged 13 commits into from Nov 3, 2017

Conversation

infograf768
Copy link
Contributor

As title says.
See #346 (comment)

@zero-24
to be checked for unvoluntary modifications of already merged PRs

@astridx Please test

@infograf768
Copy link
Contributor Author

Note: this includes and replaces #336 and #346

@astridx
Copy link
Contributor

astridx commented May 16, 2017

@infograf768 Thank you very much.
I had a first test and noticed two things.
The files in the folder media are not copied with the installation. I think we have to add an entry in the manifest file.
And I would name the entry in the select box for the associations in the singular not in the plural.
Edit: My first opinion was, because I want to edit only one web link. But I see many web links in the list, so the plural is OK. But we mixed singular and plural in this select box - contact is in singular.
multilingual associations select item type and language joomla cms test administration
This evening I will have a closer look.

@@ -200,6 +210,25 @@ public function getItem($pk = null)
$registry->loadString($item->images);
$item->images = $registry->toArray();

// Load associated newsfeeds items
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change newsfeeds to weblinks?

@@ -0,0 +1,61 @@
/**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we minimize this file?

@infograf768
Copy link
Contributor Author

on ipad now. will look later. :)

@infograf768
Copy link
Contributor Author

But we mixed singular and plural n this select box - contact is in singular.

Yep, that's the only one. It was a mistake when we merged com_associations.
We have to propose a patch on cms changing
"COM_CONTACT_CONTACTS="Contact"
to
COM_CONTACT_CONTACTS="Contacts"
in
administrator/language/en-GB/en-GB.com_contact.ini

@infograf768
Copy link
Contributor Author

Should we minimize this file?

I added the call into the manifest but not sure we need them.
I picked the one you posted in your PR and I see
// Used in xtd_contacts

Even if that is a typo, we do not have an xtd-weblinks and I do not know if we need these js at all. For example, we do not have these js for newsfeeds.

That type of js was introduced in joomla/joomla-cms#12561 and then modified.

Calling @dgt41 to look into that.

JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('behavior.core');
JHtml::_('behavior.polyfill', array('event'), 'lt IE 9');
JHtml::_('script', 'com_weblinks/admin-weblinks-modal.js', array('version' => 'auto', 'relative' => true));
Copy link
Contributor

@astridx astridx May 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need the admin-weblinks-modal.js (currently we use not the min) because we use it here. If we not have this Javascript, it is not possible to select an item when creating a menu item for the single view.

@dgrammatiko
Copy link
Contributor

Even if that is a typo, we do not have an xtd-weblinks and I do not know if we need these js at all. For example, we do not have these js for newsfeeds.

Actually there should be a button for every type of content in Joomla (newsfeed, weblink, etc)

@infograf768
Copy link
Contributor Author

OK. Will add the xtd-editor for weblinks and minimise js

@infograf768
Copy link
Contributor Author

I guess we should be OK now.

@zero-24
Please check my changes in pkg_weblinks.xml where I added the new plugin

@infograf768
Copy link
Contributor Author

Results should now be:
screen shot 2017-05-17 at 09 43 00

screen shot 2017-05-17 at 09 46 00

screen shot 2017-05-17 at 09 46 33

screen shot 2017-05-17 at 09 47 37

@astridx
Copy link
Contributor

astridx commented May 19, 2017

For me, almost everything works. I have only problems with the xtd plugin. But I think it's up to me. I'll try again tomorrow.
I only suggest to call the plugin weblinks (plural - not weblink (singular)), because we call all other plugins synonymous.

@@ -116,9 +118,11 @@ COM_WEBLINKS_ORDER_HEADING="Order"
COM_WEBLINKS_RIGHT="Right"
COM_WEBLINKS_SAVE_SUCCESS="Web link successfully saved"
COM_WEBLINKS_SEARCH_IN_TITLE="Search in title"
COM_WEBLINKS_SELECT_A_WEBLINK="Select Weblink"
Copy link
Contributor

@astridx astridx May 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we use "Web link" everywhere and not "Weblink"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep. will do
Web Link maybe. will look elsewhere.
or web link in this phrase

defined('_JEXEC') or die;

/**
* Editor WEb Link button
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Web for WEb

@infograf768
Copy link
Contributor Author

concerning name of plugin, except for fields, they are singular
PLG_ARTICLE_BUTTON_ARTICLE="Article"

https://github.com/joomla/joomla-cms/tree/staging/plugins/editors-xtd

@infograf768
Copy link
Contributor Author

@astridx
Corrections done.

@astridx
Copy link
Contributor

astridx commented May 20, 2017

I have tested this PR successfully.
I created an weblink item and translated it into the associations-component. Then I created several weblinks items in several languages and linked (associated) them in the weblinks components to another language.
Die frontend view was OK
I created a xtd-button and inserted an weblink with the help of this button into an article.

Concerning name of plugin: I meant, that the names of all other weblink plugins (finder, system, search) are in singular. But that was only a suggestion.
And I had another idea while I tested. Should we add the images to the single frontend view? At the moment we use this only for the category view. But this is only a suggestion, too. We can do this in another PR later. If you like I would open an issue for this.

@infograf768
Copy link
Contributor Author

infograf768 commented May 20, 2017

Concerning name of plugin: I meant, that the names all other weblink plugins (finder, system, search) are in singular. But that was only a suggestion.

we have to normaise vs editors-xtd plugins, not any other type. 😃

@infograf768
Copy link
Contributor Author

@zero-24
OK to merge?

@zero-24
Copy link
Contributor

zero-24 commented May 22, 2017

looks ok now from a quick review but I did not found time to test this yet. Sorry.

@astridx
Copy link
Contributor

astridx commented Jun 7, 2017

I just noticed something. If an weblink is unpulished, you can see it in this single weblink view, if you know the link. This a security problem, right?

@zero-24
Copy link
Contributor

zero-24 commented Jun 7, 2017

@infograf768
Copy link
Contributor Author

btw, folks, we are freezing languages for the CMS on the 13th.
These new strings should added to core before that date. Thanks.

@infograf768
Copy link
Contributor Author

If an weblink is unpulished, you can see it in this single weblink view, if you know the link.

It should throw a 404 when a single weblink menu item is clicked.
Looking into that now.

@infograf768
Copy link
Contributor Author

@zero-24 @dgt41 @astridx

I have now updated the frontend model for weblink. It should now take care of language, access, state.

Please test and check code.

@ghost
Copy link

ghost commented Sep 14, 2017

this PR is ready for Test?

@infograf768
Copy link
Contributor Author

It was, last time I tested. :) In June.

@ghost
Copy link

ghost commented Sep 14, 2017

can there be proper Test Instructions at first Comment?

As far as i read there should be a "single weblink" (menue?) which i can't find, also no Button so i share Comments of @infograf768 in #346 why to have multlingual as you got to an Page after click on Weblink.

@infograf768
Copy link
Contributor Author

as far as I remember, there is a already a single weblink menu item and with this patch instead of displaying directly the page targeted by this link, it displays a joomla frontend page containing the web link to click on, therefore permitting associations.

@astridx
Copy link
Contributor

astridx commented Sep 14, 2017

why to have multlingual as you got to an Page after click on Weblink.

You are right. The single view and the multilingual is not really neccessary for this component. But I think weblinks is a component where others (and I) have the opportunity to learn creating componentens.

As far as i read there should be a "single weblink"

Do I understand you right? You do not see the opportunity to create a single weblink view when you create a menu point? It should be similar to com_content, where you can create a menu item for a single article.

@ghost
Copy link

ghost commented Sep 14, 2017

correct, no "Single Weblink"-Menu Item:
bildschirmfoto 2017-09-14 um 10 26 34

Test on

weblinks-3.7.0-beta1
macOS Sierra, 10.12.5
Firefox 55.0 (64-bit)

MAMP 4.1.1

  • PHP 7.0.15
  • MySQLi 5.6.35

@astridx
Copy link
Contributor

astridx commented Sep 16, 2017

I applied the path via Patch Tester and @franz-wohlkoenig is right, here I saw no menu item for a single web link. By the way, there was no JOOMLA/components/com_weblinks/views/weblink/tmpl/default.xml file in the folder. I think patch tester can not copy new files. And this file is new in this version.

Then I applied the branch via git fetch upstream pull/349/head:weblinks_assoc and built a new pkg-weblinks-current.zip and installed this.

After that I could create a new menu item. I saw the web link in the front end, when I clicked it. After publishing these web link I saw a 404 error.

I could create web links and web links categories for other languages via multilingual component. And I saw the association tab in the web links component and I could use it.

I made some checks on a website, that is not multilingual and there was everything OK, I mean, I saw no association tab.

I had only one issue. I could not create a web link with the same alias in different languages. But I would like to merge this and open an issue for the opportunity to have the same alias for different languages.

I tested with Joomla! 3.8.0-rc2-dev Development [ Amani ] 5-September-2017 14:00 GMT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants